mirror of
https://github.com/bringout/oca-ocb-l10n_americas.git
synced 2026-04-27 06:12:06 +02:00
19.0 vanilla
This commit is contained in:
parent
89c6e82fe7
commit
1b82c20a58
572 changed files with 43570 additions and 53303 deletions
2
odoo-bringout-oca-ocb-l10n_br/l10n_br/wizard/__init__.py
Normal file
2
odoo-bringout-oca-ocb-l10n_br/l10n_br/wizard/__init__.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from . import account_move_reversal
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountMoveReversal(models.TransientModel):
|
||||
_inherit = "account.move.reversal"
|
||||
|
||||
def _compute_document_type(self):
|
||||
""" If a l10n_latam_document_type_id was set, change it in the case of Brazil to be
|
||||
the same as the move that is being reversed.
|
||||
"""
|
||||
res = super()._compute_document_type()
|
||||
for reversal in self.filtered("l10n_latam_document_type_id"):
|
||||
# LATAM invoices are guaranteed to be just one by _compute_documents_info().
|
||||
move = reversal.move_ids[0]
|
||||
if move.country_code == "BR":
|
||||
reversal.l10n_latam_document_type_id = move.l10n_latam_document_type_id
|
||||
|
||||
return res
|
||||
Loading…
Add table
Add a link
Reference in a new issue