diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-06-22 19:14:06 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-06-22 19:14:06 +0700 |
| commit | 4430c79a3388c591725cdbd12e32c6c371b6ecd3 (patch) | |
| tree | a5935e7e5fda73c7929d4ef5a84e734b9c305626 /indoteknik_custom/models/invoice_reklas.py | |
| parent | 680748ae128a90b9999acff60c770e2472c7fcbe (diff) | |
| parent | eeb72c4ed24c33403bb733a51198b9cc0f356e6a (diff) | |
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into tukar_guling
Diffstat (limited to 'indoteknik_custom/models/invoice_reklas.py')
| -rw-r--r-- | indoteknik_custom/models/invoice_reklas.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/indoteknik_custom/models/invoice_reklas.py b/indoteknik_custom/models/invoice_reklas.py index 5145e098..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 '' ) @@ -102,11 +102,15 @@ class InvoiceReklas(models.TransientModel): 'journal_id': 13 } + if invoice.purchase_order_id: + parameters_header['purchase_order_id'] = invoice.purchase_order_id.id + account_move = request.env['account.move'].create([parameters_header]) _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 |
