summaryrefslogtreecommitdiff
path: root/addons/l10n_latam_invoice_document/wizards/account_debit_note.py
blob: e84f6ba6ff071a888e1ab018415bb86c1837efbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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