summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2023-10-05 11:08:16 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2023-10-05 11:08:16 +0700
commit5614f5f0fa0322089f17feeeeeb56af93bf76670 (patch)
tree2009941da7770dd10e6801ea8adb150bcdd2674b /indoteknik_custom/models
parentd238f43442cc27db0d0c05bba99b42b41eaadf54 (diff)
mandatory email
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/sale_order.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index e201496a..93c63d56 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -392,9 +392,11 @@ class SaleOrder(models.Model):
def _set_sppkp_npwp_contact(self):
partner = self.partner_id.parent_id or self.partner_id
- partner.customer_type = self.customer_type
- partner.npwp = self.npwp
- partner.sppkp = self.sppkp
+ if not partner.sppkp or not partner.npwp or not partner.email or partner.customer_type:
+ partner.customer_type = self.customer_type
+ partner.npwp = self.npwp
+ partner.sppkp = self.sppkp
+ partner.email = self.email
def _compute_total_margin(self):
for order in self: