From c72e2ffa170e4a6205296dce4487888cc1e6fc33 Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Sun, 15 Sep 2024 14:44:43 +0300 Subject: [PATCH] Update project_invoice.py --- odex25_project/project_base/models/project_invoice.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/odex25_project/project_base/models/project_invoice.py b/odex25_project/project_base/models/project_invoice.py index 91b3cef8f..ddcc55295 100644 --- a/odex25_project/project_base/models/project_invoice.py +++ b/odex25_project/project_base/models/project_invoice.py @@ -52,6 +52,11 @@ class ProjectInvoice(models.Model): allowed_internal_user_ids = fields.Many2many('res.users', 'project_invoice_allowed_internal_users_rel', string="Allowed Internal Users", default=lambda self: self.env.user, domain=[('share', '=', False)]) allowed_portal_user_ids = fields.Many2many('res.users', 'project_invoice_allowed_portal_users_rel', string="Allowed Portal Users", domain=[('share', '=', True)]) + + @api.onchange("project_invline_ids") + def get_price_unit_value_test(self): + for rec in self: + rec.price_unit = rec.project_invoice_id.project_id.contract_value_untaxed @api.depends('invoice_id','invoice_id.invoice_payments_widget','name')