Browse Source
Merge pull request #64 from nicolasj77/followed_info_session
[IMP] Followed info session
pull/67/head
Nicolas Jamoulle
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
18 additions and
3 deletions
-
beesdoo_shift/wizard/subscribe.py
|
|
@ -26,6 +26,21 @@ class Subscribe(models.TransientModel): |
|
|
|
else: |
|
|
|
return date |
|
|
|
|
|
|
|
def _get_info_session_date(self): |
|
|
|
date = (self.env['res.partner'] |
|
|
|
.browse(self._context.get('active_id')) |
|
|
|
.info_session_date) |
|
|
|
if date and self._get_info_session_followed(): |
|
|
|
return date |
|
|
|
else: |
|
|
|
return False |
|
|
|
|
|
|
|
def _get_info_session_followed(self): |
|
|
|
session_followed = (self.env['res.partner'] |
|
|
|
.browse(self._context.get('active_id')) |
|
|
|
.info_session) |
|
|
|
return session_followed |
|
|
|
|
|
|
|
def _get_super(self): |
|
|
|
return self.env['res.partner'].browse(self._context.get('active_id')).super |
|
|
|
|
|
|
@ -34,10 +49,10 @@ class Subscribe(models.TransientModel): |
|
|
|
|
|
|
|
def _get_reset_counter_default(self): |
|
|
|
partner = self.env['res.partner'].browse(self._context.get('active_id')) |
|
|
|
return partner.state == 'unsubscribed' and partner.working_mode == 'regular' |
|
|
|
return partner.state == 'unsubscribed' and partner.working_mode == 'regular' |
|
|
|
|
|
|
|
info_session = fields.Boolean(string="Followed an information session", default=False) |
|
|
|
info_session_date = fields.Date(string="Date of information session") |
|
|
|
info_session = fields.Boolean(string="Followed an information session", default=_get_info_session_followed) |
|
|
|
info_session_date = fields.Date(string="Date of information session", default=_get_info_session_date) |
|
|
|
super = fields.Boolean(string="Super Cooperator", default=_get_super) |
|
|
|
working_mode = fields.Selection( |
|
|
|
[ |
|
|
|