[FIX] base: same vat with empty string vat
If partner.vat is an empty string, python evaluates it as falsy and doesn't check the remaining of the line. This makes the framework to send ["", ""] as values for the many2one to the browser instead of false. By forcing to have True or False, this is not a problem anymore as bool() will be False, and False will result in the correct value in the read. closes odoo/odoo#35807 Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
This commit is contained in:
@@ -273,7 +273,7 @@ class Partner(models.Model):
|
||||
domain = [('vat', '=', partner.vat)]
|
||||
if partner_id:
|
||||
domain += [('id', '!=', partner_id), '!', ('id', 'child_of', partner_id)]
|
||||
partner.same_vat_partner_id = partner.vat and not partner.parent_id and self.env['res.partner'].search(domain, limit=1)
|
||||
partner.same_vat_partner_id = bool(partner.vat) and not partner.parent_id and self.env['res.partner'].search(domain, limit=1)
|
||||
|
||||
@api.depends(lambda self: self._display_address_depends())
|
||||
def _compute_contact_address(self):
|
||||
|
||||
Reference in New Issue
Block a user