summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatherine Zaoral <kz@adhoc.com.ar>2020-08-11 18:27:59 +0000
committerKatherine Zaoral <kz@adhoc.com.ar>2020-08-11 21:48:33 +0000
commitc2bd44203421137a8e2e550d73ff28dcf2431aa7 (patch)
tree9157f2b0fd69a42730b98f097d08f720a1396284
parent0f3216047a1eea28fd0faf77ec1c390d7d2f8ec6 (diff)
[IMP] l10n_latam_invoice_document: add account_debit_note as dependency
In version 13.0 we add account_debit_note as dependency to l10n_ar_edi, but this was made because we were not able to add new depends to l10n_latam_invoice_document module in stable version. Now that we are in master we are able to add the dependency directly here and remove it from l10n_ar_edi closes odoo/odoo#55771 Related: odoo/enterprise#12361 Signed-off-by: Josse Colpaert <jco@openerp.com>
-rw-r--r--addons/l10n_latam_invoice_document/__manifest__.py1
-rw-r--r--addons/l10n_latam_invoice_document/wizards/__init__.py1
-rw-r--r--addons/l10n_latam_invoice_document/wizards/account_debit_note.py15
3 files changed, 17 insertions, 0 deletions
diff --git a/addons/l10n_latam_invoice_document/__manifest__.py b/addons/l10n_latam_invoice_document/__manifest__.py
index 82bbe9f818d..8f5554e3e7d 100644
--- a/addons/l10n_latam_invoice_document/__manifest__.py
+++ b/addons/l10n_latam_invoice_document/__manifest__.py
@@ -26,6 +26,7 @@ If your localization needs this logic will then need to add this module as depen
""",
"depends": [
"account",
+ "account_debit_note",
],
"data": [
'views/account_journal_view.xml',
diff --git a/addons/l10n_latam_invoice_document/wizards/__init__.py b/addons/l10n_latam_invoice_document/wizards/__init__.py
index 7076207375e..4d069b503bc 100644
--- a/addons/l10n_latam_invoice_document/wizards/__init__.py
+++ b/addons/l10n_latam_invoice_document/wizards/__init__.py
@@ -1,3 +1,4 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import account_move_reversal
+from . import account_debit_note
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 00000000000..763f3211d90
--- /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.with_context(internal_type='debit_note')._compute_l10n_latam_document_type()
+ return res