summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/sale_order_line.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2025-05-19 15:54:45 +0700
committerstephanchrst <stephanchrst@gmail.com>2025-05-19 15:54:45 +0700
commit62088f63cc7904c07fa3e95d7dd487fb9cd4926c (patch)
tree7fd881203cf48bda9118ace64a418cc15fe6f7ae /indoteknik_custom/models/sale_order_line.py
parentabb5b01c3bbaf19feaf1be8f3a3fac6b95a1d6a6 (diff)
bf minus delivered qty
Diffstat (limited to 'indoteknik_custom/models/sale_order_line.py')
-rw-r--r--indoteknik_custom/models/sale_order_line.py13
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: