mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
stock_location_package_restriction: fix location creation
This commit is contained in:
@@ -86,10 +86,12 @@ class StockLocation(models.Model):
|
||||
|
||||
@api.depends("package_restriction")
|
||||
def _compute_package_restriction_violation(self):
|
||||
self.env.cr.execute(
|
||||
self._has_package_restriction_violation_query(), (tuple(self.ids),)
|
||||
)
|
||||
errors = {r[0]: r[1:] for r in self.env.cr.fetchall()}
|
||||
errors = {}
|
||||
if self.ids:
|
||||
self.env.cr.execute(
|
||||
self._has_package_restriction_violation_query(), (tuple(self.ids),)
|
||||
)
|
||||
errors = {r[0]: r[1:] for r in self.env.cr.fetchall()}
|
||||
for location in self:
|
||||
error = errors.get(location.id)
|
||||
if not error:
|
||||
|
||||
Reference in New Issue
Block a user