base_partner_one2many_phone: improve country handling in phone reformat

This commit is contained in:
Alexis de Lattre
2021-08-23 18:50:43 +02:00
parent 48a19b8f97
commit 939de0c9bd

View File

@@ -46,7 +46,7 @@ class ResPartnerPhone(models.Model):
@api.onchange('phone', 'partner_id') @api.onchange('phone', 'partner_id')
def _onchange_phone_validation(self): def _onchange_phone_validation(self):
if self.phone: if self.phone:
self.phone = self.phone_format(self.phone) self.phone = self.phone_format(self.phone, country=self.partner_id.country_id)
@api.constrains('type', 'phone', 'email') @api.constrains('type', 'phone', 'email')
def _check_partner_phone(self): def _check_partner_phone(self):