Browse Source

Merge PR #885 into 12.0

Signed-off-by pedrobaeza
12.0
OCA-git-bot 5 years ago
parent
commit
a8c54566e5
  1. 3
      partner_industry_secondary/models/res_partner.py

3
partner_industry_secondary/models/res_partner.py

@ -17,7 +17,8 @@ class ResPartner(models.Model):
@api.constrains('industry_id', 'secondary_industry_ids') @api.constrains('industry_id', 'secondary_industry_ids')
def _check_industries(self): def _check_industries(self):
if self.industry_id in self.secondary_industry_ids:
for partner in self:
if partner.industry_id in partner.secondary_industry_ids:
raise exceptions.ValidationError( raise exceptions.ValidationError(
_('The main industry must be different ' _('The main industry must be different '
'from the secondary industries.')) 'from the secondary industries.'))
Loading…
Cancel
Save