diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-09-13 14:06:10 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-09-13 14:06:10 +0700 |
| commit | 65e9e2bb3886b5275263a3b9ffce7c04757da26d (patch) | |
| tree | f58f9f994ea93ffd9867e89dd2459622f38d1ed9 | |
| parent | 6c624a595d961138cf4e65724bd401e374ee6642 (diff) | |
add produk sementara validation
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 6f901809..08349bd3 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -46,6 +46,13 @@ class SaleOrder(models.Model): # self.approval_status = False # return super(SaleOrder, self).action_cancel() + def action_confirm(self): + for line in self.order_line: + if line.product_id.id == 232383: + raise UserError(_('Tidak bisa Confirm menggunakan Produk Sementara')) + res = super(SaleOrder, self).action_confirm() + return res + def compute_total_margin(self): for order in self: total_margin = total_percent_margin = 0 |
