Enable is_animator Boolean in contact

This commit is contained in:
Youssef Elouahby 2018-10-23 16:28:03 +01:00
parent 9deb04a196
commit b9639ebef6
1 changed files with 13 additions and 0 deletions

View File

@ -136,6 +136,13 @@ class GolemActivity(models.Model):
date_start = fields.Date('Start date', copy=False)
date_stop = fields.Date('End date', copy=False)
@api.constrains('animator_id')
def save_animator_id(self):
""" Enabling is_animator flag """
for activity in self:
activity.animator_id.is_animator = True
@api.onchange('date_start')
def _onchange_date_start(self):
""" Sets end date to start date if no start date """
@ -221,3 +228,9 @@ class ProductCategory(models.Model):
property_account_income_categ_id = fields.Many2one(required=True)
property_account_expense_categ_id = fields.Many2one(required=True)
class ResPartner(models.Model):
""" GOLEM Member partner adaptations """
_inherit = 'res.partner'
is_animator = fields.Boolean()