Skip to content
Snippets Groups Projects
Commit e3afae05 authored by Marco Folco's avatar Marco Folco
Browse files

Merge branch 'SOF-44-Agrupador_prestaciones' into '12.0-stage'

[MOD] payment order and view

See merge request !22
parents 27396ae1 870b8040
No related branches found
No related tags found
1 merge request!22[MOD] payment order and view
No preview for this file type
......@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-06 20:43+0000\n"
"PO-Revision-Date: 2021-01-06 17:44-0300\n"
"POT-Creation-Date: 2021-01-07 18:42+0000\n"
"PO-Revision-Date: 2021-01-07 15:43-0300\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
......@@ -358,6 +358,7 @@ msgstr "Mes"
#. module: medical_invoicing
#: model:ir.model.fields,field_description:medical_invoicing.field_account_invoice_line__owed_quantity
#: model:ir.model.fields,field_description:medical_invoicing.field_account_payment_order_invoice_line__owed_quantity
msgid "Owed Quantity"
msgstr "Cantidad adeudada"
......@@ -428,17 +429,21 @@ msgid "Professionals"
msgstr "Profesionales"
#. module: medical_invoicing
#: model:ir.model.fields,field_description:medical_invoicing.field_account_payment_order_invoice_line__quantity
#: model_terms:ir.ui.view,arch_db:medical_invoicing.report_invoice_detail_template
msgid "Quantity"
msgstr "Cantidad"
#. module: medical_invoicing
#: code:addons/medical_invoicing/models/account_payment_order.py:31
#: code:addons/medical_invoicing/models/account_payment_order.py:32
#, python-format
msgid "Quantity must be greater than 0 and lower than the owed quantity"
msgstr "La cantidad debe ser mayor que 0 y menor que la cantidad adeudada"
#. module: medical_invoicing
#: model:ir.model.fields,field_description:medical_invoicing.field_account_payment_order_invoice_line__quantity
msgid "Quantity to pay"
msgstr "Cantidad a pagar"
#. module: medical_invoicing
#: model:ir.model.fields,field_description:medical_invoicing.field_account_invoice_line__refund_reason
msgid "Refund Reason"
......
......@@ -18,7 +18,8 @@ class AccountPaymentOrderInvoiceLine(models.Model):
descriptor_id = fields.Many2one('medical.benefit.descriptor',related='invoice_line_id.descriptor_id',string='Descriptor')
price_unit = fields.Float(string='Price Unit')
price_total = fields.Float(string='Price Total', compute="_compute_price_total", store=True)
quantity = fields.Float(string='Quantity')
quantity = fields.Float(string='Quantity to pay')
owed_quantity = fields.Float(string='Owed Quantity')
@api.depends('invoice_line_id','quantity','price_unit')
def _compute_price_total(self):
......@@ -34,6 +35,7 @@ class AccountPaymentOrderInvoiceLine(models.Model):
def create(self, vals):
res = super(AccountPaymentOrderInvoiceLine, self).create(vals)
res.quantity = res.invoice_line_id.owed_quantity
res.owed_quantity = res.invoice_line_id.owed_quantity
res.price_unit = res.invoice_line_id.price_total / res.invoice_line_id.quantity
res.price_total = res.price_unit * res.quantity
return res
......@@ -43,6 +45,7 @@ class AccountPaymentOrderInvoiceLine(models.Model):
super(AccountPaymentOrderInvoiceLine, self).write(vals)
if 'invoice_line_id' in vals:
self.quantity = self.invoice_line_id.owed_quantity
res.owed_quantity = res.invoice_line_id.owed_quantity
self.price_unit = self.invoice_line_id.price_total / self.invoice_line_id.quantity
self.price_total = self.price_unit * self.quantity
......
......@@ -18,7 +18,9 @@
<tree editable="bottom" create="false">
<field name="professional_id" readonly="1"/>
<field name="descriptor_id" readonly="1"/>
<field name="owed_quantity" readonly="1"/>
<field name="quantity"/>
<field name="price_unit" invisible="1"/>
<field name="price_total" readonly="1"/>
</tree>
</field>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment