[FIX] stock: qty_available at date company owned
should take into account inventory/production location with companies
used in avco/standard at date
followup of rev 67ea26460f
opw-2027859
This commit is contained in:
@@ -160,9 +160,23 @@ class Product(models.Model):
|
||||
company_id = self.env.user.company_id.id
|
||||
return (
|
||||
[('location_id.company_id', '=', company_id), ('location_id.usage', 'in', ['internal', 'transit'])],
|
||||
[('location_id.company_id', '=', False), ('location_dest_id.company_id', '=', company_id)],
|
||||
[('location_id.company_id', '=', company_id), ('location_dest_id.company_id', '=', False),
|
||||
])
|
||||
['&',
|
||||
('location_dest_id.company_id', '=', company_id),
|
||||
'|',
|
||||
('location_id.company_id', '=', False),
|
||||
'&',
|
||||
('location_id.usage', 'in', ['inventory', 'production']),
|
||||
('location_id.company_id', '=', company_id),
|
||||
],
|
||||
['&',
|
||||
('location_id.company_id', '=', company_id),
|
||||
'|',
|
||||
('location_dest_id.company_id', '=', False),
|
||||
'&',
|
||||
('location_dest_id.usage', 'in', ['inventory', 'production']),
|
||||
('location_dest_id.company_id', '=', company_id),
|
||||
]
|
||||
)
|
||||
location_ids = []
|
||||
if self.env.context.get('location', False):
|
||||
if isinstance(self.env.context['location'], pycompat.integer_types):
|
||||
|
||||
Reference in New Issue
Block a user