[FIX] l10n_latam_base: avoid singleton error

limit identification type search result in one
record to avoid apparent singleton error

closes odoo/odoo#50380

X-original-commit: fe62fbc520a7daee8006d2b453d0b2f2459ce1ad
Signed-off-by: Josse Colpaert <jco@openerp.com>
This commit is contained in:
Nikunj Ladava
2020-04-29 10:31:07 +00:00
parent 63e47974bc
commit f3ee9de11b
+1 -1
View File
@@ -25,4 +25,4 @@ class ResPartner(models.Model):
def _onchange_country(self):
country = self.country_id or self.company_id.country_id or self.env.company.country_id
self.l10n_latam_identification_type_id = self.env['l10n_latam.identification.type'].search(
[('country_id', '=', country.id), ('is_vat', '=', True)]) or self.env.ref('l10n_latam_base.it_vat', raise_if_not_found=False)
[('country_id', '=', country.id), ('is_vat', '=', True)], limit=1) or self.env.ref('l10n_latam_base.it_vat', raise_if_not_found=False)