diff options
Diffstat (limited to 'indoteknik_custom/models/sale_order_line.py')
| -rw-r--r-- | indoteknik_custom/models/sale_order_line.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order_line.py b/indoteknik_custom/models/sale_order_line.py index 2450abd4..049bee2d 100644 --- a/indoteknik_custom/models/sale_order_line.py +++ b/indoteknik_custom/models/sale_order_line.py @@ -41,6 +41,19 @@ class SaleOrderLine(models.Model): qty_free_bu = fields.Float(string='Free BU', compute='_get_qty_free_bandengan') desc_updatable = fields.Boolean(string='desc boolean', default=True, compute='_get_desc_updatable') + def _get_outgoing_incoming_moves(self): + outgoing_moves = self.env['stock.move'] + incoming_moves = self.env['stock.move'] + + for move in self.move_ids.filtered(lambda r: r.state != 'cancel' and not r.scrapped and self.product_id == r.product_id): + if move.location_dest_id.usage == "customer": + if not move.origin_returned_move_id or (move.origin_returned_move_id and move.to_refund): + outgoing_moves |= move + elif move.location_id.usage == "customer" and move.to_refund: + incoming_moves |= move + + return outgoing_moves, incoming_moves + def _get_desc_updatable(self): for line in self: if line.product_id.id != 417724 and line.product_id.id: |
