Skip to content
Snippets Groups Projects
Commit 0b13c303 authored by Lucas Perais (lpe)'s avatar Lucas Perais (lpe)
Browse files

[FIX] l10n_be_intrastat: propagate country_id


Before this commit, the field intrastat_country_id was not propagated when refunding an invoice

After this commit, the refund invoice takes the same values for that field
as the invoice it is refunding

OPW 2028333

closes odoo/odoo#35309

Signed-off-by: default avatarLucas Perais (lpe) <lpe@odoo.com>
parent 3748ac5d
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,17 @@ class AccountInvoice(models.Model):
help='Intrastat country, delivery for sales, origin for purchases',
domain=[('intrastat', '=', True)])
@api.model
def _prepare_refund(self, invoice, date_invoice=None, date=None, description=None, journal_id=None):
"""
Correctly set intrastat_country_id
@override
"""
values = super(AccountInvoice, self)._prepare_refund(invoice, date_invoice, date, description, journal_id)
if 'intrastat_country_id' not in values:
values['intrastat_country_id'] = invoice.intrastat_country_id.id
return values
class IntrastatRegion(models.Model):
_name = 'l10n_be_intrastat.region'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment