[QUA]Minor enhancement for Member class

This commit is contained in:
Fabien Bourgeois 2017-06-05 08:37:33 +02:00
parent e0f517fb45
commit 5ddb5a91e7

View File

@ -61,6 +61,9 @@ class GolemMember(models.Model):
_description = 'GOLEM Member'
_inherit = 'mail.thread'
_inherits = {'res.partner': 'partner_id'}
_sql_constraints = [('golem_member_number_manual_uniq',
'UNIQUE (number_manual)',
_('This member number has already been used.'))]
partner_id = fields.Many2one('res.partner', required=True, index=True,
ondelete='cascade')
@ -87,10 +90,6 @@ class GolemMember(models.Model):
is_number_manual = fields.Boolean('Is number manual?', store=False,
compute='_compute_is_number_manual')
_sql_constraints = [('golem_member_number_manual_uniq',
'UNIQUE (number_manual)',
_('This member number has already been used.'))]
@api.multi
@api.depends('season_ids')
def compute_is_current(self):