[REF] stock: allow domain selection hook
Add hook to allow override of domain in orderpoint scheduler. Closes #16909 opw-743020
This commit is contained in:
committed by
Nicolas Martinelli
parent
edb8221cbb
commit
477b8176c1
@@ -279,6 +279,11 @@ class ProcurementOrder(models.Model):
|
||||
def _procurement_from_orderpoint_post_process(self, orderpoint_ids):
|
||||
return True
|
||||
|
||||
def _get_orderpoint_domain(self, company_id=False):
|
||||
domain = [('company_id', '=', company_id)] if company_id else []
|
||||
domain += [('product_id.active', '=', True)]
|
||||
return domain
|
||||
|
||||
@api.model
|
||||
def _procure_orderpoint_confirm(self, use_new_cursor=False, company_id=False):
|
||||
""" Create procurements based on orderpoints.
|
||||
@@ -288,9 +293,7 @@ class ProcurementOrder(models.Model):
|
||||
"""
|
||||
|
||||
OrderPoint = self.env['stock.warehouse.orderpoint']
|
||||
|
||||
domain = [('company_id', '=', company_id)] if company_id else []
|
||||
domain += [('product_id.active', '=', True)]
|
||||
domain = self._get_orderpoint_domain(company_id=company_id)
|
||||
orderpoints_noprefetch = OrderPoint.with_context(prefetch_fields=False).search(domain,
|
||||
order=self._procurement_from_orderpoint_get_order()).ids
|
||||
while orderpoints_noprefetch:
|
||||
|
||||
Reference in New Issue
Block a user