[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>
This commit is contained in:
Katherine Zaoral
2020-08-11 21:48:33 +00:00
parent 0f3216047a
commit c2bd442034
3 changed files with 17 additions and 0 deletions
@@ -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',
@@ -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
@@ -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