diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-10-07 10:35:40 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-10-07 10:35:40 +0700 |
| commit | 04709ff9faa72f0c9d6ca4a51f203859e79596de (patch) | |
| tree | 2937b7f68c524f598454499a3029c278bdab4ff1 | |
| parent | fe6b304a65fd7e576382d871558b3c404b9dd40a (diff) | |
cr vendor approval
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 0f22a7d4..f24a4bf3 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -716,13 +716,13 @@ class SaleOrder(models.Model): raise UserError("Salesperson sudah tidak aktif, mohon diisi yang benar pada data SO dan Contact") def sale_order_approve(self): + if self.validate_different_vendor() and not self.vendor_approval and not self.vendor_approval_id: + return self._create_notification_action('Notification', 'Terdapat Vendor yang berbeda dengan MD Vendor') self.check_due() self._validate_order() for order in self: order.order_line.validate_line() - if order.validate_different_vendor() and not self.vendor_approval: - return self._create_notification_action('Notification', 'Terdapat Vendor yang berbeda dengan MD Vendor') partner = order.partner_id.parent_id or order.partner_id if not partner.property_payment_term_id: @@ -865,7 +865,7 @@ class SaleOrder(models.Model): def action_confirm(self): for order in self: - if order.validate_different_vendor() and not self.vendor_approval: + if self.validate_different_vendor() and not self.vendor_approval and not self.vendor_approval_id: return self._create_notification_action('Notification', 'Terdapat Vendor yang berbeda dengan MD Vendor') order.check_data_real_delivery_address() |
