update app

This commit is contained in:
ivan deng
2018-11-21 21:25:23 +08:00
parent 0626f8a102
commit de30842c16

View File

@@ -9,17 +9,7 @@ class ResPartner(models.Model):
short_name = fields.Char('Short Name') # 简称 short_name = fields.Char('Short Name') # 简称
# 在原唯一检查中增加ref唯一 # ref编码限制在 app_partner_auto_reference
_sql_constraints = [
('uniq_ref', 'unique(ref)', _('The reference must be unique')),
]
@api.constrains('ref')
def _check_ref(self):
customers = self.search([('ref', '=', self.ref)], limit=2)
if len(customers) > 1:
raise ValidationError(_('The reference must be unique!'))
# 显示[编码]简称 # 显示[编码]简称
@api.multi @api.multi
def name_get(self): def name_get(self):