Files
suite/stock_warehouse_procurement/models/procurement.py
Jared Kipe 09f97c078f IMP stock_warehouse_procurement also filter 'exception' stock moves by warehouse
Note that there are 'to assign' moves that do not use a method to get the domain, this is a known limitation.
2019-12-03 16:29:58 -08:00

20 lines
695 B
Python

from odoo import models
class ProcurementGroup(models.Model):
_inherit = 'procurement.group'
def _get_orderpoint_domain(self, company_id=False):
domain = super(ProcurementGroup, self)._get_orderpoint_domain(company_id)
warehouse_id = self.env.context.get('warehouse_id', None)
if warehouse_id:
domain.append(('warehouse_id', '=', warehouse_id))
return domain
def _get_exceptions_domain(self):
domain = super(ProcurementGroup, self)._get_exceptions_domain()
warehouse_id = self.env.context.get('warehouse_id')
if warehouse_id:
domain.append(('warehouse_id', '=', warehouse_id))
return domain