diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2024-01-09 06:34:24 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2024-01-09 06:34:24 +0000 |
| commit | 6f62411bf3965fc27e24d8c997cc2bca771a0b8e (patch) | |
| tree | 3c0dc3837885ddf0e644558b46b598909b06d504 /indoteknik_custom/models/account_move.py | |
| parent | 5b607722945ac1b64eb3e6f2393a441064783342 (diff) | |
| parent | 7622354cbe00ca428d94469c6bd5ae3de5e73a76 (diff) | |
Merged in multiple-reklas (pull request #134)
Multiple reklas
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 82a86a39..ae09d0ee 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -35,6 +35,26 @@ class AccountMove(models.Model): ('belum_upload', 'Belum Upload FP'), ('sudah_upload', 'Sudah Upload FP'), ], 'Mark Upload Faktur', compute='_compute_mark_upload_efaktur', default='belum_upload') + sale_id = fields.Many2one('sale.order', string='Sale Order') + reklas_id = fields.Many2one('account.move', string='Nomor CAB', domain="[('partner_id', '=', partner_id)]") + + def open_form_multi_create_reklas_penjualan(self): + action = self.env['ir.actions.act_window']._for_xml_id('indoteknik_custom.action_view_invoice_reklas_penjualan') + invoice = self.env['invoice.reklas.penjualan'].create([{ + '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, + }]) + action['res_id'] = invoice.id + return action def _compute_mark_upload_efaktur(self): for move in self: |
