[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:
@@ -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'):
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user