diff options
Diffstat (limited to 'fixco_custom/models/account_move.py')
| -rw-r--r-- | fixco_custom/models/account_move.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fixco_custom/models/account_move.py b/fixco_custom/models/account_move.py index f491bc4..971e9e3 100644 --- a/fixco_custom/models/account_move.py +++ b/fixco_custom/models/account_move.py @@ -33,6 +33,27 @@ class AccountMove(models.Model): ) faktur_pajak = fields.Char('Faktur Pajak') count_payment = fields.Integer('Count Payment', compute='_compute_count_payment') + reklas_misc_id = fields.Many2one('account.move', string='Journal Entries Reklas') + purchase_order_id = fields.Many2one('purchase.order', string='Purchase Order') + bill_id = fields.Many2one('account.move', string='Vendor Bill', domain=[('move_type', '=', 'in_invoice')], help='Bill asal dari proses reklas ini') + + def open_form_multi_create_reklas_penjualan(self): + action = self.env['ir.actions.act_window']._for_xml_id('fixco_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_count_payment(self): for move in self: |
