summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/sale_order.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2024-10-23 10:22:26 +0700
committerstephanchrst <stephanchrst@gmail.com>2024-10-23 10:22:26 +0700
commit70a6cf87d721e9e6c78d27a9e9ef4168ad96fac7 (patch)
treee3d609724a143db1f8a7ae34caec537da032bec4 /indoteknik_custom/models/sale_order.py
parent943ee3ca2e3b8469d1f3969fa6ea45710e532fc0 (diff)
parent25645d93db289ea4855486630dba8d578efb2851 (diff)
Merge branch 'production' into feature/generate_url
Diffstat (limited to 'indoteknik_custom/models/sale_order.py')
-rwxr-xr-xindoteknik_custom/models/sale_order.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 891482cb..1ad08154 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -873,17 +873,16 @@ class SaleOrder(models.Model):
}).send()
def validate_different_vendor(self):
- if self.vendor_approval_id and self.vendor_approval:
- return False
-
- different_vendor = self.order_line.filtered(lambda l: l.vendor_id and l.vendor_md_id and l.vendor_id.id != l.vendor_md_id.id)
-
if self.vendor_approval_id and self.vendor_approval_id.state == 'draft':
raise UserError('SO ini sedang dalam review Vendor Approval')
if self.vendor_approval_id and self.vendor_approval_id.state == 'cancel':
raise UserError('Vendor Approval SO ini Di Reject')
+ if self.vendor_approval_id and self.vendor_approval_id.state == 'done':
+ return False
+
+ different_vendor = self.order_line.filtered(lambda l: l.vendor_id and l.vendor_md_id and l.vendor_id.id != l.vendor_md_id.id)
if different_vendor:
vendor_approval = self.env['vendor.approval'].create({
'order_id': self.id,