summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/sale_order.py
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-10-13 13:01:35 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-10-13 13:01:35 +0700
commitdab2cdebb698b817b979efd2087175060f9b8f03 (patch)
tree2f301bebebe9d187415cda0c663b00d7f02eac03 /indoteknik_custom/models/sale_order.py
parent40c66acf47f900ecd776358758ac053347c078c7 (diff)
<Miqdad> change SO line behavior onchange vendor_id
Diffstat (limited to 'indoteknik_custom/models/sale_order.py')
-rwxr-xr-xindoteknik_custom/models/sale_order.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 2d2d71b3..3bd1ca59 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -3230,7 +3230,10 @@ class SaleOrder(models.Model):
# order._auto_set_shipping_from_website()
order._compute_etrts_date()
order._validate_expected_ready_ship_date()
- order.onchange_vendor_id()
+ for line in order.order_line:
+ updated_vals = line._update_purchase_info()
+ if updated_vals:
+ line.write(updated_vals)
# order._validate_delivery_amt()
# order._check_total_margin_excl_third_party()
# order._update_partner_details()
@@ -3362,6 +3365,12 @@ class SaleOrder(models.Model):
if any(field in vals for field in ["order_line", "client_order_ref"]):
self._calculate_etrts_date()
+ for order in self:
+ for line in order.order_line:
+ updated_vals = line._update_purchase_info()
+ if updated_vals:
+ line.write(updated_vals)
+
return res
def button_refund(self):