[FIX] stock: fixed singleton in picking write method

closes odoo/odoo#71535

X-original-commit: 922ee844f699fdb230b32d3f8c06ff22476f99c3
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
This commit is contained in:
Jeremy Cormier
2021-06-01 11:06:00 +00:00
parent be0c9bc5af
commit eaed74dec0
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -667,7 +667,7 @@ class Picking(models.Model):
return res
def write(self, vals):
if vals.get('picking_type_id') and self.state != 'draft':
if vals.get('picking_type_id') and any(picking.state != 'draft' for picking in self):
raise UserError(_("Changing the operation type of this record is forbidden at this point."))
# set partner as a follower and unfollow old partner
if vals.get('partner_id'):
+2
View File
@@ -14,3 +14,5 @@ List of contributors:
Christian LECOUFLE christian.lecoufle@subteno-it.fr https://github.com/cle-subteno-it
Vincent COFFIN vincent.coffin@subteno-it.fr https://github.com/vco-subteno-it
Jeremy CORMIER jco@subteno.com https://github.com/jco-subteno-it
Jeremy CORMIER jeremy.cormier@subteno-it.fr https://github.com/jco-subteno-it