[FIX] stock: compute location on quant package

The field 'location_id' on quant package is not computed anymore, as all
quants of a package are in the same location we take the location of the
first quant
This commit is contained in:
Pierre Masereel
2017-08-22 17:20:56 +02:00
parent 472384e658
commit cde29c29eb
+2
View File
@@ -267,6 +267,8 @@ class QuantPackage(models.Model):
def _compute_package_info(self):
for package in self:
values = {'location_id': False, 'company_id': self.env.user.company_id.id, 'owner_id': False}
if self.quant_ids:
values['location_id'] = self.quant_ids[0].location_id
package.location_id = values['location_id']
package.company_id = values['company_id']
package.owner_id = values['owner_id']