diff --git a/beesdoo_shift/__openerp__.py b/beesdoo_shift/__openerp__.py index ba56969..dc23e2e 100644 --- a/beesdoo_shift/__openerp__.py +++ b/beesdoo_shift/__openerp__.py @@ -32,5 +32,6 @@ "wizard/batch_template.xml", "wizard/assign_super_coop.xml", "wizard/subscribe.xml", + "wizard/extension.xml", ], } diff --git a/beesdoo_shift/models/cooperative_status.py b/beesdoo_shift/models/cooperative_status.py index e8aea50..8256a99 100644 --- a/beesdoo_shift/models/cooperative_status.py +++ b/beesdoo_shift/models/cooperative_status.py @@ -208,5 +208,22 @@ class ResPartner(models.Model): res['context'] = {'default_unsubscribed': True} return res + @api.multi + def manual_extension(self): + return { + 'name': _('Manual Extension'), + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'beesdoo.shift.extension', + 'target': 'new', + } + + @api.multi + def auto_extension(self): + res = self.manual_extension() + res['context'] = {'default_auto': True} + res['name'] = _('Trigger Grace Delay') + return res #TODO access right + vue on res.partner #TODO can_shop : Status can_shop ou extempted ou part C diff --git a/beesdoo_shift/views/cooperative_status.xml b/beesdoo_shift/views/cooperative_status.xml index 91c1dd5..b650073 100644 --- a/beesdoo_shift/views/cooperative_status.xml +++ b/beesdoo_shift/views/cooperative_status.xml @@ -15,7 +15,14 @@ ('cooperator_type', '!=', 'share_a'), '|', ('state', '!=', 'suspended'), - ('extension_start_time', '!=', False)]}"/> + ('extension_start_time', '!=', False)]}" /> +