summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-10-21 09:19:50 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-10-21 09:19:50 +0700
commiteadc70481dd65dd7483aa2ae5c9bcc68bb274f3e (patch)
tree359149627df1163af7c89d4606f28573ee29e19f
parenta4006a9c7f57bbc11ba0c519e69719ded8248ad3 (diff)
fix bug vendor approval
-rwxr-xr-xindoteknik_custom/models/sale_order.py3
-rw-r--r--indoteknik_custom/models/vendor_approval.py2
2 files changed, 4 insertions, 1 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index cb7d1782..891482cb 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -873,6 +873,9 @@ 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':
diff --git a/indoteknik_custom/models/vendor_approval.py b/indoteknik_custom/models/vendor_approval.py
index e540b8fc..b0d58b85 100644
--- a/indoteknik_custom/models/vendor_approval.py
+++ b/indoteknik_custom/models/vendor_approval.py
@@ -29,7 +29,7 @@ class VendorApproval(models.Model):
raise UserError('Hanya Merchandiser yang bisa approve')
self.state = 'done'
- self.order_id.update({'vendor_approval': True})
+ self.order_id.vendor_approval = True
self.order_id.action_confirm()
message = "Vendor Approval approved by %s" % (self.env.user.name)
self.order_id.message_post(body=message)