diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2026-01-12 12:26:45 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2026-01-12 12:26:45 +0700 |
| commit | ecf44f0bf4070de945baa5a2e0e3641a1a1018b7 (patch) | |
| tree | cbd3d2554b5c16101ddf79057899c28dba30f2bb /fixco_custom/models/invoice_reklas.py | |
| parent | f68b59fe48c186eab40783b993c27c2fc2491832 (diff) | |
push reklas
Diffstat (limited to 'fixco_custom/models/invoice_reklas.py')
| -rw-r--r-- | fixco_custom/models/invoice_reklas.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fixco_custom/models/invoice_reklas.py b/fixco_custom/models/invoice_reklas.py index 584d357..37fd4d7 100644 --- a/fixco_custom/models/invoice_reklas.py +++ b/fixco_custom/models/invoice_reklas.py @@ -102,6 +102,8 @@ class InvoiceReklas(models.TransientModel): current_time = datetime.now() for invoice in invoices: + if invoice.reklas_id: + raise UserError('Invoice {} sudah di reklas'.format(invoice.name)) # Ambil nama PO jika ada po_name = invoice.purchase_id.name if invoice.purchase_id else '' @@ -120,6 +122,7 @@ class InvoiceReklas(models.TransientModel): 'date': current_time, 'journal_id': 19, 'sale_id': invoice.sale_id.id, + 'purchase_order_id': invoice.purchase_order_id.id, 'reklas': True, } @@ -127,6 +130,7 @@ class InvoiceReklas(models.TransientModel): parameters_header['purchase_id'] = invoice.purchase_id.id account_move = request.env['account.move'].create([parameters_header]) + invoice.reklas_id = account_move.id _logger.info('Success Reklas with %s' % account_move.name) # ✅ Set Bill asal sebagai source document |
