Skip to content
Snippets Groups Projects
Commit ef87e548 authored by Juliana's avatar Juliana
Browse files

[ADD]Add field total amount task ids

parent e7e392a9
Branches 12.0
No related tags found
No related merge requests found
......@@ -51,6 +51,16 @@ class AccountInvoice(models.Model):
readonly=True,
store=False,
)
amount_task_total = odooFields.Monetary(
string='Total Séances', store=True,
readonly=True, compute='_compute_amount_task_total')
@api.one
@api.depends('task_ids', 'task_ids.cout_seance')
def _compute_amount_task_total(self):
if self.type == "in_invoice":
self.amount_task_total = sum(
line.cout_seance for line in self.task_ids)
@api.depends('project_id')
def _compute_partner_id_domain(self):
......
......@@ -66,6 +66,11 @@
<field name="cout_seance" sum="Total" />
</tree>
</field>
<group>
<group class="oe_subtotal_footer oe_right">
<field name="amount_task_total"/>
</group>
</group>
</page>
</xpath>
......@@ -81,6 +86,8 @@
<field name="origin" position="replace"/>
<field name="amount_untaxed_invoice_signed" position="replace"/>
<field name="amount_tax_signed" position="replace"/>
<field name="amount_total_signed" position="replace"/>
<field name="residual_signed" position="replace"/>
<field name="date_invoice" position="after">
<field name="project_id"/>
<field name="num_dossier"/>
......@@ -88,6 +95,7 @@
</field>
<field name="reference" position="replace">
<field name="reference" string="Numéro Facture"/>
<field name="amount_task_total" string="Total" sum="Total"/>
</field>
</field>
</record>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment