diff options
| author | Indoteknik . <it@fixcomart.co.id> | 2025-06-19 17:22:29 +0700 |
|---|---|---|
| committer | Indoteknik . <it@fixcomart.co.id> | 2025-06-19 17:22:29 +0700 |
| commit | 498e5c757cdc08691956f2cad6ff5bd40755e7c1 (patch) | |
| tree | f9e42c7eaeb66a70211187d86625de2ca35406ad | |
| parent | 3be1e1707547d40f618f70bd18e54519842e95a1 (diff) | |
(andri) fix value reference setelah reklas
| -rw-r--r-- | indoteknik_custom/models/invoice_reklas.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/indoteknik_custom/models/invoice_reklas.py b/indoteknik_custom/models/invoice_reklas.py index 58299d3e..4ed7f0bf 100644 --- a/indoteknik_custom/models/invoice_reklas.py +++ b/indoteknik_custom/models/invoice_reklas.py @@ -87,10 +87,10 @@ class InvoiceReklas(models.TransientModel): po_name = invoice.purchase_order_id.name if invoice.purchase_order_id else '' # Susun nama referensi dengan aman - ref_name = 'REKLAS {} UANG MUKA {} {}{} {}'.format( + ref_name = 'REKLAS {} UANG MUKA {}{}{} {}'.format( self.reklas_id.name or '', 'PENJUALAN' if self.reklas_type == 'penjualan' else 'PEMBELIAN', - invoice.name or '', + f" {invoice.name}" if invoice.name != self.reklas_id.name else '', f" - {po_name}" if po_name else '', invoice.partner_id.name or '' ) @@ -109,7 +109,8 @@ class InvoiceReklas(models.TransientModel): _logger.info('Success Reklas with %s' % account_move.name) # ✅ Set Bill asal sebagai source document - account_move.bill_id = invoice.id + if invoice.move_type == 'in_invoice': + account_move.bill_id = invoice.id # Tambahkan info asal invoice ke jurnal (opsional) account_move.invoice_origin = invoice.name |
