diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-08-06 10:33:25 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-08-06 10:33:25 +0700 |
| commit | 9fb81ccccb8f2735ac5811d81b644b0ae70c4d8e (patch) | |
| tree | 96b251ab9b7d6b0de6f74b1b4a189a2aa7be037e | |
| parent | 1db0c2f6148e5c13454cc25e4d4d877756536a4b (diff) | |
<miqdad> push
| -rw-r--r-- | indoteknik_custom/models/tukar_guling.py | 24 | ||||
| -rw-r--r-- | indoteknik_custom/models/tukar_guling_po.py | 26 |
2 files changed, 25 insertions, 25 deletions
diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py index d511779e..3091acce 100644 --- a/indoteknik_custom/models/tukar_guling.py +++ b/indoteknik_custom/models/tukar_guling.py @@ -320,17 +320,17 @@ class TukarGuling(models.Model): # ('state', '!=', 'cancel') # ]) > 0 - def _check_invoice_on_revisi_so(self): - for record in self: - if record.return_type == 'revisi_so' and record.origin: - invoices = self.env['account.move'].search([ - ('invoice_origin', 'ilike', record.origin), - ('state', 'not in', ['draft', 'cancel']) - ]) - if invoices: - raise ValidationError( - _("Tidak bisa memilih Return Type 'Revisi SO' karena dokumen %s sudah dibuat invoice.") % record.origin - ) + # def _check_invoice_on_revisi_so(self): + # for record in self: + # if record.return_type == 'revisi_so' and record.origin: + # invoices = self.env['account.move'].search([ + # ('invoice_origin', 'ilike', record.origin), + # ('state', 'not in', ['draft', 'cancel']) + # ]) + # if invoices: + # raise ValidationError( + # _("Tidak bisa memilih Return Type 'Revisi SO' karena dokumen %s sudah dibuat invoice.") % record.origin + # ) @api.model def create(self, vals): @@ -577,7 +577,7 @@ class TukarGuling(models.Model): elif rec.state == 'approval_finance': if not rec.env.user.has_group('indoteknik_custom.group_role_fat'): raise UserError("Hanya Finance Manager yang boleh approve tahap ini.") - rec._check_invoice_on_revisi_so() + # rec._check_invoice_on_revisi_so() rec.set_opt() rec.state = 'approval_logistic' rec.date_finance = now diff --git a/indoteknik_custom/models/tukar_guling_po.py b/indoteknik_custom/models/tukar_guling_po.py index 72fb1607..38afaac6 100644 --- a/indoteknik_custom/models/tukar_guling_po.py +++ b/indoteknik_custom/models/tukar_guling_po.py @@ -106,18 +106,18 @@ class TukarGulingPO(models.Model): return res - def _check_bill_on_revisi_po(self): - for record in self: - if record.return_type == 'revisi_po' and record.origin: - bills = self.env['account.move'].search([ - ('invoice_origin', 'ilike', record.origin), - ('move_type', '=', 'in_invoice'), # hanya vendor bill - ('state', 'not in', ['draft', 'cancel']) - ]) - # if bills: - # raise ValidationError( - # _("Tidak bisa memilih Return Type 'Revisi PO' karena PO %s sudah dibuat vendor bill. Harus Cancel Jika ingin melanjutkan") % record.origin - # ) + # def _check_bill_on_revisi_po(self): + # for record in self: + # if record.return_type == 'revisi_po' and record.origin: + # bills = self.env['account.move'].search([ + # ('invoice_origin', 'ilike', record.origin), + # ('move_type', '=', 'in_invoice'), # hanya vendor bill + # ('state', 'not in', ['draft', 'cancel']) + # ]) + # if bills: + # raise ValidationError( + # _("Tidak bisa memilih Return Type 'Revisi PO' karena PO %s sudah dibuat vendor bill. Harus Cancel Jika ingin melanjutkan") % record.origin + # ) @api.onchange('operations') def _onchange_operations(self): @@ -438,7 +438,7 @@ class TukarGulingPO(models.Model): elif rec.state == 'approval_finance': if not rec.env.user.has_group('indoteknik_custom.group_role_fat'): raise UserError("Hanya Finance yang boleh approve tahap ini.") - rec._check_bill_on_revisi_po() + # rec._check_bill_on_revisi_po() rec.set_opt() rec.state = 'approval_logistic' rec.date_finance = now |
