diff --git a/beesdoo_shift/__openerp__.py b/beesdoo_shift/__openerp__.py
index dc23e2e..e6f8a71 100644
--- a/beesdoo_shift/__openerp__.py
+++ b/beesdoo_shift/__openerp__.py
@@ -33,5 +33,6 @@
"wizard/assign_super_coop.xml",
"wizard/subscribe.xml",
"wizard/extension.xml",
+ "wizard/holiday.xml",
],
}
diff --git a/beesdoo_shift/models/cooperative_status.py b/beesdoo_shift/models/cooperative_status.py
index 2bf0e78..10955ee 100644
--- a/beesdoo_shift/models/cooperative_status.py
+++ b/beesdoo_shift/models/cooperative_status.py
@@ -225,5 +225,17 @@ class ResPartner(models.Model):
res['context'] = {'default_auto': True}
res['name'] = _('Trigger Grace Delay')
return res
+
+ @api.multi
+ def register_holiday(self):
+ return {
+ 'name': _('Register Holiday'),
+ 'type': 'ir.actions.act_window',
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'beesdoo.shift.holiday',
+ 'target': 'new',
+ }
+
#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 318ec0d..f5c3f02 100644
--- a/beesdoo_shift/views/cooperative_status.xml
+++ b/beesdoo_shift/views/cooperative_status.xml
@@ -26,6 +26,9 @@
+
diff --git a/beesdoo_shift/wizard/__init__.py b/beesdoo_shift/wizard/__init__.py
index 474c92e..2aa4b25 100644
--- a/beesdoo_shift/wizard/__init__.py
+++ b/beesdoo_shift/wizard/__init__.py
@@ -2,4 +2,5 @@ import instanciate_planning
import batch_template
import assign_super_coop
import subscribe
-import extension
\ No newline at end of file
+import extension
+import holiday
\ No newline at end of file
diff --git a/beesdoo_shift/wizard/extension.py b/beesdoo_shift/wizard/extension.py
index 1a5255b..eeb791d 100644
--- a/beesdoo_shift/wizard/extension.py
+++ b/beesdoo_shift/wizard/extension.py
@@ -33,5 +33,3 @@ class Subscribe(models.TransientModel):
if today_delay < 0:
raise UserError(_('You should not start a manual extension during the grace delay'))
status_id.sudo().write({'time_extension': self.extension_days + today_delay})
-
- #TO continue
diff --git a/beesdoo_shift/wizard/holiday.py b/beesdoo_shift/wizard/holiday.py
new file mode 100644
index 0000000..f6634b4
--- /dev/null
+++ b/beesdoo_shift/wizard/holiday.py
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+from openerp import models, fields, api, _
+
+class Subscribe(models.TransientModel):
+ _name = 'beesdoo.shift.holiday'
+ _inherit = 'beesdoo.shift.action_mixin'
+
+ holiday_start_day = fields.Date(string="Start date for the holiday", default=fields.Date.today)
+ holiday_end_day = fields.Date(string="End date for the holiday (included)")
+
+ @api.multi
+ def holidays(self):
+ self = self._check() #maybe a different group
+ status_id = self.env['cooperative.status'].search([('cooperator_id', '=', self.cooperator_id.id)])
+ status_id.sudo().write({'holiday_start_time': self.holiday_start_day, 'holiday_end_time': self.holiday_end_day})
diff --git a/beesdoo_shift/wizard/holiday.xml b/beesdoo_shift/wizard/holiday.xml
new file mode 100644
index 0000000..ca7b1c6
--- /dev/null
+++ b/beesdoo_shift/wizard/holiday.xml
@@ -0,0 +1,20 @@
+
+
+ Holiday Management
+ beesdoo.shift.holiday
+
+
+
+
+