mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
FIX wrong model for seach method
This commit is contained in:
@@ -40,9 +40,9 @@ class StockLocation(models.Model):
|
||||
locations = self.search(
|
||||
[('parent_left', '<=', self.parent_left),
|
||||
('parent_right', '>=', self.parent_right)])
|
||||
warehouses = self.search(
|
||||
[('lot_stock_id', 'in', [x.id for x in locations]),
|
||||
('region_id', '!=', False)])
|
||||
warehouses = self.env['stock.warehouse'].search([
|
||||
('lot_stock_id', 'in', [x.id for x in locations]),
|
||||
('region_id', '!=', False)])
|
||||
if warehouses:
|
||||
return warehouses[0].region_id
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user