diff --git a/l10n_do_accounting/models/account_move.py b/l10n_do_accounting/models/account_move.py index 7c7b7f715..ffd0e2bd3 100644 --- a/l10n_do_accounting/models/account_move.py +++ b/l10n_do_accounting/models/account_move.py @@ -653,14 +653,14 @@ def _get_debit_line_tax(self, debit_date): if self.move_type == "out_invoice": return ( self.company_id.account_sale_tax_id - or self.env.ref("l10n_do.%s_tax_18_sale" % self.company_id.id) + or self.env.ref("account.%s_tax_18_sale" % self.company_id.id) if (debit_date - self.invoice_date).days <= 30 and self.partner_id.l10n_do_dgii_tax_payer_type != "special" - else self.env.ref("l10n_do.%s_tax_0_sale" % self.company_id.id) or False + else self.env.ref("account.%s_tax_0_sale" % self.company_id.id) or False ) else: return self.company_id.account_purchase_tax_id or self.env.ref( - "l10n_do.%s_tax_0_purch" % self.company_id.id + "account.%s_tax_0_purch" % self.company_id.id ) def _post(self, soft=True): diff --git a/l10n_do_accounting/wizard/account_debit_note.py b/l10n_do_accounting/wizard/account_debit_note.py index c92b64e1d..fe4caa16a 100644 --- a/l10n_do_accounting/wizard/account_debit_note.py +++ b/l10n_do_accounting/wizard/account_debit_note.py @@ -176,37 +176,37 @@ def _prepare_default_values(self, move): ) ) - origin_invoice_id = self.move_ids or self.env["account.move"].browse( - self.env.context.get("active_ids") - ) - taxes = ( - [ + origin_invoice_id = self.move_ids or self.env["account.move"].browse( + self.env.context.get("active_ids") + ) + taxes = ( + [ + ( + 6, + 0, + [origin_invoice_id._get_debit_line_tax(res["invoice_date"]).id], + ) + ] + if self.l10n_do_debit_type + else [(5, 0)] + ) + price_unit = ( + self.l10n_do_amount + if self.l10n_do_debit_type == "fixed_amount" + else origin_invoice_id.amount_untaxed * (self.l10n_do_percentage / 100) + ) + res["invoice_line_ids"] = [ ( - 6, 0, - [origin_invoice_id._get_debit_line_tax(res["invoice_date"]).id], + 0, + { + "name": self.reason or _("Debit"), + "price_unit": price_unit, + "quantity": 1, + "tax_ids": taxes, + }, ) ] - if self.l10n_do_debit_type - else [(5, 0)] - ) - price_unit = ( - self.l10n_do_amount - if self.l10n_do_debit_type == "fixed_amount" - else origin_invoice_id.amount_untaxed * (self.l10n_do_percentage / 100) - ) - res["invoice_line_ids"] = [ - ( - 0, - 0, - { - "name": self.reason or _("Debit"), - "price_unit": price_unit, - "quantity": 1, - "tax_ids": taxes, - }, - ) - ] return res