[FIX] stock: prevent location change

Changing the partner on a picking triggers an onchange which might
modify `location_id` or `location_dest_id`. However, when the picking is
not draft anymore, these fields are not supposed to be changed.

opw-1872635
This commit is contained in:
Nicolas Martinelli
2018-09-11 10:21:14 +02:00
committed by Nicolas Martinelli
parent 816f386161
commit 097963624f
+3 -2
View File
@@ -470,8 +470,9 @@ class Picking(models.Model):
else:
location_dest_id, supplierloc = self.env['stock.warehouse']._get_partner_locations()
self.location_id = location_id
self.location_dest_id = location_dest_id
if self.state == 'draft':
self.location_id = location_id
self.location_dest_id = location_dest_id
# TDE CLEANME move into onchange_partner_id
if self.partner_id:
if self.partner_id.picking_warn == 'no-message' and self.partner_id.parent_id: