From d6749184c9c4f3b061eb93ff83d3cf6f797bd919 Mon Sep 17 00:00:00 2001 From: Kev-Roche Date: Mon, 4 Sep 2023 17:04:16 +0200 Subject: [PATCH] fix emails for requisition proposal --- purchase_requisition_proposal/data/data.xml | 8 ++------ .../models/purchase_requisition.py | 4 ++-- .../views/purchase_requisition.xml | 1 - 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/purchase_requisition_proposal/data/data.xml b/purchase_requisition_proposal/data/data.xml index 1ba745bdf..57b4d53e5 100644 --- a/purchase_requisition_proposal/data/data.xml +++ b/purchase_requisition_proposal/data/data.xml @@ -30,9 +30,7 @@ ${object.company_id.name} Call for Proposals (Ref ${object.name or 'n/a' }) - ${','.join([str(partner.id) for partner in object.company_to_call_ids.partner_id]} +

@@ -106,9 +104,7 @@ ${object.company_id.name} Closed Call for Proposals (Ref ${object.name or 'n/a' }) - ${','.join([str(partner.id) for partner in object.company_to_call_ids.partner_id]} +

diff --git a/purchase_requisition_proposal/models/purchase_requisition.py b/purchase_requisition_proposal/models/purchase_requisition.py index 78c1a1005..5f2b7dce3 100644 --- a/purchase_requisition_proposal/models/purchase_requisition.py +++ b/purchase_requisition_proposal/models/purchase_requisition.py @@ -39,7 +39,7 @@ class PurchaseRequisition(models.Model): string="Qty", ) - @api.depends("exclusive") + @api.depends("exclusive", "multi_company_selection", "type_id.company_to_call_ids") def _compute_company_to_call_ids(self): for rec in self: if ( @@ -47,7 +47,7 @@ def _compute_company_to_call_ids(self): and rec.type_id.multi_company_selection != "no" ): if rec.type_id.multi_company_selection == "selected": - rec.company_to_call_ids = rec.type_id.company_to_call_ids + rec.company_to_call_ids = [(6, 0, rec.type_id.company_to_call_ids.ids)] else: rec.company_to_call_ids = rec.env["res.company"].search( [("id", "!=", rec.company_id.id)] diff --git a/purchase_requisition_proposal/views/purchase_requisition.xml b/purchase_requisition_proposal/views/purchase_requisition.xml index 811c3966f..2e6bd0971 100644 --- a/purchase_requisition_proposal/views/purchase_requisition.xml +++ b/purchase_requisition_proposal/views/purchase_requisition.xml @@ -55,7 +55,6 @@ name="action_create_quotations" string="Create proposal Quotations" type="object" - states="open, done" class="btn-primary" />