-
+
@@ -133,6 +143,11 @@
Type:
+
+ Super Coop:
+
+
+
Worker Number:
@@ -162,8 +177,10 @@
-
-
+
+
@@ -224,7 +241,7 @@
+ parent="menu_root" groups="beesdoo_shift.group_planning_management" />
Day Number
diff --git a/beesdoo_shift/wizard/__init__.py b/beesdoo_shift/wizard/__init__.py
index f405bb9..b022bda 100644
--- a/beesdoo_shift/wizard/__init__.py
+++ b/beesdoo_shift/wizard/__init__.py
@@ -1,2 +1,3 @@
import instanciate_planning
-import batch_template
\ No newline at end of file
+import batch_template
+import assign_super_coop
\ No newline at end of file
diff --git a/beesdoo_shift/wizard/assign_super_coop.py b/beesdoo_shift/wizard/assign_super_coop.py
new file mode 100644
index 0000000..c34a783
--- /dev/null
+++ b/beesdoo_shift/wizard/assign_super_coop.py
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+from openerp import models, fields, api, _
+
+
+class AssignSuperCoop(models.TransientModel):
+ _name = 'beesddoo.shift.assign_super_coop'
+
+ super_coop_id = fields.Many2one('res.users', 'New Super Cooperative', required=True, domain=[('super', '=', True)])
+ shift_ids = fields.Many2many('beesdoo.shift.shift', readonly=True, default=lambda self: self._context.get('active_ids'))
+
+ @api.multi
+ def write_super_coop(self):
+ self.ensure_one()
+ self.shift_ids.write({'super_coop_id' : self.super_coop_id.id})
diff --git a/beesdoo_shift/wizard/assign_super_coop.xml b/beesdoo_shift/wizard/assign_super_coop.xml
new file mode 100644
index 0000000..c1b7328
--- /dev/null
+++ b/beesdoo_shift/wizard/assign_super_coop.xml
@@ -0,0 +1,27 @@
+
+
+ Assign Super Coop
+ beesddoo.shift.assign_super_coop
+
+
+
+
+
+
+
+
+
+
diff --git a/beesdoo_shift/wizard/batch_template.py b/beesdoo_shift/wizard/batch_template.py
index a81bb54..4cb4cff 100644
--- a/beesdoo_shift/wizard/batch_template.py
+++ b/beesdoo_shift/wizard/batch_template.py
@@ -9,7 +9,7 @@ from openerp import models, fields, api, _
class GenerateShiftTemplate(models.TransientModel):
_name = 'beesddoo.shift.generate_shift_template'
-
+
day_ids = fields.Many2many('beesdoo.shift.daynumber', relation='template_gen_day_number_rel', column1='wizard_id', column2='day_id')
planning_id = fields.Many2one('beesdoo.shift.planning', required=True)
type_id = fields.Many2one('beesdoo.shift.type', default=lambda self: self._context.get('active_id'))
diff --git a/beesdoo_shift/wizard/batch_template.xml b/beesdoo_shift/wizard/batch_template.xml
index 556e95e..f1a1191 100644
--- a/beesdoo_shift/wizard/batch_template.xml
+++ b/beesdoo_shift/wizard/batch_template.xml
@@ -10,8 +10,9 @@
-
-
+
+
@@ -20,8 +21,9 @@
-
-
+
+
@@ -30,9 +32,10 @@
diff --git a/beesdoo_shift/wizard/instanciate_planning.py b/beesdoo_shift/wizard/instanciate_planning.py
index dfd770d..fa99787 100644
--- a/beesdoo_shift/wizard/instanciate_planning.py
+++ b/beesdoo_shift/wizard/instanciate_planning.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from openerp import models, fields, api
+from openerp import models, fields, api, _
class InstanciatePlanning(models.TransientModel):
@@ -15,4 +15,14 @@ class InstanciatePlanning(models.TransientModel):
def generate_task(self):
self.ensure_one()
self = self.with_context(visualize_date=self.date_start)
- self.planning_id.task_template_ids._generate_task_day()
+ shifts = self.planning_id.task_template_ids._generate_task_day()
+ return {
+ 'name': _('Generated Shift'),
+ 'type': 'ir.actions.act_window',
+ 'view_type': 'form',
+ 'view_mode': 'kanban,calendar,tree,form,pivot',
+ 'res_model': 'beesdoo.shift.shift',
+ 'target': 'current',
+ 'domain': [('id', 'in', shifts.ids)],
+ 'context' : {'search_default_gb_day': 1}
+ }
\ No newline at end of file
diff --git a/beesdoo_shift/wizard/instanciate_planning.xml b/beesdoo_shift/wizard/instanciate_planning.xml
index 3d917c4..edb187e 100644
--- a/beesdoo_shift/wizard/instanciate_planning.xml
+++ b/beesdoo_shift/wizard/instanciate_planning.xml
@@ -9,12 +9,12 @@
-