diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-01-08 13:26:16 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-01-08 13:26:16 +0700 |
| commit | 7622354cbe00ca428d94469c6bd5ae3de5e73a76 (patch) | |
| tree | 3c0dc3837885ddf0e644558b46b598909b06d504 | |
| parent | e5474a12a7d3b0d8c1a73d5e072078e6be745196 (diff) | |
multiple invoice reklas penjualan
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 2 | ||||
| -rw-r--r-- | indoteknik_custom/models/invoice_reklas_penjualan.py | 3 | ||||
| -rw-r--r-- | indoteknik_custom/views/invoice_reklas_penjualan.xml | 1 |
3 files changed, 5 insertions, 1 deletions
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 @@ <field name="pay_amt" required="1"/> <field name="reklas_id" required="1"/> <field name="amount_untaxed_signed" readonly="1"/> + <field name="sale_id" readonly="1"/> <field name="amount_total_signed" readonly="1"/> </tree> </field> |
