diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index ca7aabe19c2..bfd27051a54 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -319,8 +319,8 @@ class PurchaseOrder(models.Model): def button_approve(self, force=False): self.write({'state': 'purchase', 'date_approve': fields.Date.context_today(self)}) self._create_picking() - if self.company_id.po_lock == 'lock': - self.write({'state': 'done'}) + self.filtered( + lambda p: p.company_id.po_lock == 'lock').write({'state': 'done'}) return {} @api.multi diff --git a/doc/cla/corporate/wink.md b/doc/cla/corporate/wink.md new file mode 100644 index 00000000000..59b22c1b64b --- /dev/null +++ b/doc/cla/corporate/wink.md @@ -0,0 +1,15 @@ +Belgium, 2018-04-06 + +WINK SA/NV agrees to the terms of the Odoo Corporate Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Thomas Fossoul tfossoul@wink.be https://github.com/tfossoulw + +List of contributors: + +Thomas Fossoul tfossoul@wink.be https://github.com/tfossoulw