From 7622354cbe00ca428d94469c6bd5ae3de5e73a76 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Mon, 8 Jan 2024 13:26:16 +0700 Subject: multiple invoice reklas penjualan --- indoteknik_custom/models/account_move.py | 2 ++ indoteknik_custom/models/invoice_reklas_penjualan.py | 3 ++- indoteknik_custom/views/invoice_reklas_penjualan.xml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 47eb90f8..ae09d0ee 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -44,10 +44,12 @@ class AccountMove(models.Model): 'name': '-', }]) for move in self: + sale_id = move.sale_id.id self.env['invoice.reklas.penjualan.line'].create([{ 'invoice_reklas_id': invoice.id, 'name': move.name, 'partner_id': move.partner_id.id, + 'sale_id': move.sale_id.id, 'amount_untaxed_signed': move.amount_untaxed_signed, 'amount_total_signed': move.amount_total_signed, }]) diff --git a/indoteknik_custom/models/invoice_reklas_penjualan.py b/indoteknik_custom/models/invoice_reklas_penjualan.py index 22417864..533270d2 100644 --- a/indoteknik_custom/models/invoice_reklas_penjualan.py +++ b/indoteknik_custom/models/invoice_reklas_penjualan.py @@ -70,7 +70,8 @@ class InvoiceReklasPenjualanLine(models.TransientModel): invoice_reklas_id = fields.Many2one('invoice.reklas.penjualan', string='Invoice Reklas') pay_amt = fields.Float(string='Yang dibayarkan') - reklas_id = fields.Many2one('account.move', string='Nomor CAB', domain="[('partner_id', '=', partner_id)]") + reklas_id = fields.Many2one('account.move', string='Nomor CAB', domain="[('sale_id', '=', sale_id)]") + sale_id = fields.Many2one('sale.order', string='Sale Order') amount_untaxed_signed = fields.Float(string='Tax excluded') amount_total_signed = fields.Float(string='Total') name = fields.Char(string='Name') diff --git a/indoteknik_custom/views/invoice_reklas_penjualan.xml b/indoteknik_custom/views/invoice_reklas_penjualan.xml index ba892633..9c875cca 100644 --- a/indoteknik_custom/views/invoice_reklas_penjualan.xml +++ b/indoteknik_custom/views/invoice_reklas_penjualan.xml @@ -17,6 +17,7 @@ + -- cgit v1.2.3