From ade0fe34d2d77fa9ee8e275cb60301b325710bd1 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 17 Sep 2025 18:05:45 +0700 Subject: coretax --- fixco_custom/models/account_move.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'fixco_custom/models/account_move.py') diff --git a/fixco_custom/models/account_move.py b/fixco_custom/models/account_move.py index 836b878..bb84573 100644 --- a/fixco_custom/models/account_move.py +++ b/fixco_custom/models/account_move.py @@ -42,6 +42,22 @@ class AccountMove(models.Model): reklas_used = fields.Boolean('Reklas Used?', compute='_compute_reklas_used') reklas_used_by = fields.Many2one('account.move', string='Reklas Used By', compute='_compute_reklas_used') + def export_faktur_to_xml(self): + valid_invoices = self + + coretax_faktur = self.env['coretax.faktur'].create({}) + + response = coretax_faktur.export_to_download( + invoices=valid_invoices + ) + + valid_invoices.write({ + 'is_efaktur_exported': True, + 'date_efaktur_exported': datetime.utcnow(), + }) + + return response + @api.depends('line_ids.reconciled', 'line_ids.matching_number') def _compute_reklas_used(self): for move in self: -- cgit v1.2.3