summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/sale_order.py
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2024-03-15 11:12:46 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2024-03-15 11:12:46 +0700
commita774c1bd0b2dc1ee27a08b6b4da7162bdb7a9365 (patch)
tree896eabe285a1d68a489f8d92154b6efa00d8ad32 /indoteknik_custom/models/sale_order.py
parentd3e3a8abf0ae382442c16a7ac6091c7bb872313f (diff)
Fix compute fulfillment feature in sale order
Diffstat (limited to 'indoteknik_custom/models/sale_order.py')
-rwxr-xr-xindoteknik_custom/models/sale_order.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 32ffc964..d046bb00 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -86,6 +86,17 @@ class SaleOrder(models.Model):
picking_iu_id = fields.Many2one('stock.picking', 'Picking IU')
helper_by_id = fields.Many2one('res.users', 'Helper By')
eta_date = fields.Datetime(string='ETA Date', copy=False, compute='_compute_eta_date')
+ compute_fullfillment = fields.Boolean(string='Compute Fullfillment', compute="_compute_fullfillment")
+
+ def _compute_fullfillment(self):
+ for rec in self:
+ for fullfillment in rec.fullfillment_line:
+ fullfillment.sales_order_id = False
+
+ for line in rec.order_line:
+ line._compute_reserved_from()
+
+ rec.compute_fullfillment = True
def _compute_eta_date(self):
max_leadtime = 0