diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2016-08-04 10:08:15 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2016-08-04 10:08:15 +0200 |
| commit | efdce58913fde986f0f5ea7a279c83fcd505d3db (patch) | |
| tree | 3921ac05972778f7eb9ebac425df08cc7d0f6550 /addons | |
| parent | 2bc65af1891a68004a8b03ade675b95dbf26c6e1 (diff) | |
[FIX] purchase: confirm only draft/sent PO
Without this fix, it is possible to confirm a PO which is not in state
'draft' and 'sent'. The issue is that it will create a picking at every
call.
The issue was occurring in Purchase Requisition, which was fixed in
previous commit. However, it makes sense to add a check directly in the
`button_confirm` method.
opw-684347
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/purchase/purchase.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 8681a75617f..2123b4bec5b 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -281,6 +281,8 @@ class PurchaseOrder(models.Model): @api.multi def button_confirm(self): for order in self: + if order.state not in ['draft', 'sent']: + continue order._add_supplier_to_product() # Deal with double validation process if order.company_id.po_double_validation == 'one_step'\ |
