summaryrefslogtreecommitdiff
path: root/addons/l10n_latam_invoice_document/wizards/account_debit_note.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/l10n_latam_invoice_document/wizards/account_debit_note.py')
-rw-r--r--addons/l10n_latam_invoice_document/wizards/account_debit_note.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/addons/l10n_latam_invoice_document/wizards/account_debit_note.py b/addons/l10n_latam_invoice_document/wizards/account_debit_note.py
new file mode 100644
index 00000000..e84f6ba6
--- /dev/null
+++ b/addons/l10n_latam_invoice_document/wizards/account_debit_note.py
@@ -0,0 +1,15 @@
+from odoo import models
+
+
+class AccountDebitNote(models.TransientModel):
+
+ _inherit = 'account.debit.note'
+
+ def create_debit(self):
+ """ Properly compute the latam document type of type debit note. """
+ res = super().create_debit()
+ new_move_id = res.get('res_id')
+ if new_move_id:
+ new_move = self.env['account.move'].browse(new_move_id)
+ new_move._compute_l10n_latam_document_type()
+ return res