|
@ -17,7 +17,7 @@ class StockPicking(models.Model): |
|
|
|
|
|
|
|
|
# Custom Section |
|
|
# Custom Section |
|
|
@api.model |
|
|
@api.model |
|
|
def _prepare_filter_for_pos(self): |
|
|
|
|
|
|
|
|
def _prepare_filter_for_pos(self, pos_session_id): |
|
|
return [ |
|
|
return [ |
|
|
('state', 'in', ['confirmed', 'partially_available', 'assigned']), |
|
|
('state', 'in', ['confirmed', 'partially_available', 'assigned']), |
|
|
('invoice_state', '=', '2binvoiced'), |
|
|
('invoice_state', '=', '2binvoiced'), |
|
@ -28,12 +28,12 @@ class StockPicking(models.Model): |
|
|
return ['name', 'partner_id', 'min_date', 'origin'] |
|
|
return ['name', 'partner_id', 'min_date', 'origin'] |
|
|
|
|
|
|
|
|
@api.model |
|
|
@api.model |
|
|
def search_pickings_for_pos(self, query): |
|
|
|
|
|
|
|
|
def search_pickings_for_pos(self, query, pos_session_id): |
|
|
# Get Picking Types available for PoS |
|
|
# Get Picking Types available for PoS |
|
|
picking_type_obj = self.env['stock.picking.type'] |
|
|
picking_type_obj = self.env['stock.picking.type'] |
|
|
picking_types = picking_type_obj.search( |
|
|
picking_types = picking_type_obj.search( |
|
|
[('available_in_pos', '=', True)]) |
|
|
[('available_in_pos', '=', True)]) |
|
|
condition = self._prepare_filter_for_pos() + [ |
|
|
|
|
|
|
|
|
condition = self._prepare_filter_for_pos(pos_session_id) + [ |
|
|
('picking_type_id', 'in', picking_types.ids), |
|
|
('picking_type_id', 'in', picking_types.ids), |
|
|
'|', '|', |
|
|
'|', '|', |
|
|
('name', 'ilike', query), |
|
|
('name', 'ilike', query), |
|
|