summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorPrakash Prajapati <ppr@odoo.com>2018-11-26 07:02:14 +0000
committerArnold Moyaux <arm@odoo.com>2018-11-28 04:51:02 +0000
commit679cf0d83fa527ca28c3debc347dedac0d5a5a5b (patch)
tree2479949029329f9b96d454b4c524d372353f6952 /addons
parent54472d9c138473ab84b8ec4b03123bfd3928fe30 (diff)
[FIX] purchase_requisition: Request Approval on exclusive requisition
Usecase to reproduce: - Enable 'Managers must approve orders' - Set agreement type as 'exclusive' - Connect as purchase user - Create a requisition and an RFQ linked to it - Confirm the RFQ It raises a usererror that ask to close other PO linked to requisition. It happens because the purchase requisition code do not take care of double validation on PO. It will try to close the requisition once button_confirm is called. However it will only write 'to approve' on PO state and thus trigger the requistion error will be raise since all linked PO are not 'done' or 'cancel'. In order to fix it, the action_done on requisition should be call on button_approve instead of button_confirm. (button_approve is automatically called when double validation is not enable). Task: #1884410 Closes #28068 closes odoo/odoo#29049
Diffstat (limited to 'addons')
-rw-r--r--addons/purchase_requisition/models/purchase_requisition.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/purchase_requisition/models/purchase_requisition.py b/addons/purchase_requisition/models/purchase_requisition.py
index c752cd9189f..f2cde3cd9fe 100644
--- a/addons/purchase_requisition/models/purchase_requisition.py
+++ b/addons/purchase_requisition/models/purchase_requisition.py
@@ -257,8 +257,8 @@ class PurchaseOrder(models.Model):
self.order_line = order_lines
@api.multi
- def button_confirm(self):
- res = super(PurchaseOrder, self).button_confirm()
+ def button_approve(self, force=False):
+ res = super(PurchaseOrder, self).button_approve(force=force)
for po in self:
if not po.requisition_id:
continue