From ca707502a691cfbd04779e509450f4fa55a2cf42 Mon Sep 17 00:00:00 2001 From: dat-odoo Date: Fri, 17 Aug 2018 11:40:34 +0200 Subject: [PATCH] [FIX] purchase_requisition: vendor name management from purchase agreements. Purchase orders created from purchase agreement behave differently depending on the agreement type. On one hand, if the agreement is a blanket order, the vendor must be set automatically on the purchase order and be the same as the BO. Changing the vendor is forbidden. On the other hand, if the agreement is a call for tender, multiple purchase order can be created with different vendors. It that case, the vendor field must be editable in RfQ states. This commit is related to task ID 1866975. --- addons/purchase_requisition/models/purchase_requisition.py | 1 + .../views/purchase_requisition_views.xml | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/purchase_requisition/models/purchase_requisition.py b/addons/purchase_requisition/models/purchase_requisition.py index d9d7b4e2055..fd4a19e8b39 100644 --- a/addons/purchase_requisition/models/purchase_requisition.py +++ b/addons/purchase_requisition/models/purchase_requisition.py @@ -291,6 +291,7 @@ class PurchaseOrder(models.Model): _inherit = "purchase.order" requisition_id = fields.Many2one('purchase.requisition', string='Purchase Agreement', copy=False) + is_quantity_copy = fields.Selection(related='requisition_id.is_quantity_copy') @api.onchange('requisition_id') def _onchange_requisition_id(self): diff --git a/addons/purchase_requisition/views/purchase_requisition_views.xml b/addons/purchase_requisition/views/purchase_requisition_views.xml index 01d90b20a6f..93030beeb2c 100644 --- a/addons/purchase_requisition/views/purchase_requisition_views.xml +++ b/addons/purchase_requisition/views/purchase_requisition_views.xml @@ -79,9 +79,8 @@ - + +