Browse Source

[FIX] b_shift_attendance: Tests

pull/133/head
Rémy Taymans 5 years ago
parent
commit
503a133476
  1. 2
      beesdoo_shift/__manifest__.py
  2. 84
      beesdoo_shift/demo/cooperators.xml
  3. 39
      beesdoo_shift/demo/templates.xml
  4. 3
      beesdoo_shift_attendance/__manifest__.py
  5. 46
      beesdoo_shift_attendance/demo/tasks.xml
  6. 12
      beesdoo_shift_attendance/demo/workers.xml
  7. 21
      beesdoo_shift_attendance/tests/test_beesdoo_shift.py

2
beesdoo_shift/__manifest__.py

@ -38,8 +38,6 @@
"wizard/temporary_exemption.xml", "wizard/temporary_exemption.xml",
], ],
'demo': [ 'demo': [
"demo/cooperators.xml",
"demo/workers.xml",
"demo/templates.xml", "demo/templates.xml",
] ]
} }

84
beesdoo_shift/demo/cooperators.xml

@ -1,84 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 Coop IT Easy
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="res_partner_cooperator_1_demo" model="res.partner">
<field name="name">Fernand Peso</field>
<field name="customer" eval="True"/>
<field name="is_company" eval="False"/>
<field name="email">fernand_peso@demo.net</field>
<field name="street">Avenue des Bas-de-Callanques, 15</field>
<field name="city">Etterbeek</field>
<field name="zip">1040</field>
<field name="country_id" ref="base.be"/>
<field name="working_mode">regular</field>
<field name="is_worker" eval="True" />
</record>
<record id="res_partner_cooperator_2_demo" model="res.partner">
<field name="name">Dupont Dupont</field>
<field name="customer" eval="True"/>
<field name="is_company" eval="False"/>
<field name="email">d_dupont@demo.net</field>
<field name="street">Rue des sables, 20</field>
<field name="city">Bruxelles</field>
<field name="zip">10000</field>
<field name="country_id" ref="base.be"/>
<field name="working_mode">irregular</field>
<field name="is_worker" eval="True" />
</record>
<record id="res_partner_cooperator_3_demo" model="res.partner">
<field name="name">Ronan Le Gall</field>
<field name="customer" eval="True"/>
<field name="is_company" eval="False"/>
<field name="email">ronan_gall@demo.net</field>
<field name="street">Rue des pecheurs, 23</field>
<field name="city">Landudec</field>
<field name="zip">29710</field>
<field name="country_id" ref="base.fr"/>
<field name="working_mode">regular</field>
<field name="is_worker" eval="True" />
</record>
<record id="res_partner_cooperator_4_demo" model="res.partner">
<field name="name">Elouan Bees</field>
<field name="customer" eval="True"/>
<field name="is_company" eval="False"/>
<field name="email">elouan_bees@demo.net</field>
<field name="street">Rue Wéry, 15</field>
<field name="city">Ixelles</field>
<field name="zip">1050</field>
<field name="country_id" ref="base.be"/>
<field name="working_mode">irregular</field>
<field name="is_worker" eval="True" />
</record>
<record id="res_partner_cooperator_5_demo" model="res.partner">
<field name="name">Anne de Marchalo</field>
<field name="customer" eval="True"/>
<field name="is_company" eval="False"/>
<field name="email">anne_marchalo@demo.net</field>
<field name="street">Rue du Wels, 6</field>
<field name="city">Nantes</field>
<field name="zip">44000</field>
<field name="country_id" ref="base.fr"/>
<field name="working_mode">regular</field>
<field name="is_worker" eval="True" />
</record>
<record id="res_partner_cooperator_6_demo" model="res.partner">
<field name="name">Jean Beaumont</field>
<field name="customer" eval="True"/>
<field name="is_company" eval="False"/>
<field name="email">jean_beaumont@demo.net</field>
<field name="street">Rue de la Jungle, 8</field>
<field name="city">St-Gilles</field>
<field name="zip">1060</field>
<field name="country_id" ref="base.be"/>
<field name="working_mode">regular</field>
<field name="is_worker" eval="True" />
</record>
</odoo>

39
beesdoo_shift/demo/templates.xml

@ -65,43 +65,4 @@
<field name="name">Semaine A</field> <field name="name">Semaine A</field>
</record> </record>
<record id="beesdoo_shift_task_template_1_demo" model="beesdoo.shift.template">
<field name="name">A_LUN_7:00-9:30</field>
<field name="planning_id" ref="beesdoo_shift_planning_1_demo" />
<field name="day_nb_id" ref="beesdoo_shift_daynumber_1_demo" />
<field name="task_type_id" ref="beesdoo_shift_task_type_3_demo" />
<field name="start_time">7</field>
<field name="end_time">9.5</field>
<field name="duration">2.5</field>
<field name="worker_nb">12</field>
<!-- WARNING: issue, worker not registered in demo -->
<field name="worker_ids" eval="[(6, 0, [ref('beesdoo_shift.res_partner_cooperator_1_demo')])]"/>
</record>
<record id="beesdoo_shift_task_template_2_demo" model="beesdoo.shift.template">
<field name="name">A_MAR_12:00-14:30</field>
<field name="planning_id" ref="beesdoo_shift_planning_1_demo" />
<field name="day_nb_id" ref="beesdoo_shift_daynumber_2_demo" />
<field name="task_type_id" ref="beesdoo_shift_task_type_2_demo" />
<field name="start_time">12</field>
<field name="end_time">14.5</field>
<field name="duration">2.5</field>
<field name="worker_nb">9</field>
<!-- WARNING: issue, worker not registered in demo -->
<field name="worker_ids" eval="[(6, 0, [ref('beesdoo_shift.res_partner_cooperator_3_demo')])]"/>
</record>
<record id="beesdoo_shift_task_template_3_demo" model="beesdoo.shift.template">
<field name="name">A_VEN_7:00-9:30</field>
<field name="planning_id" ref="beesdoo_shift_planning_1_demo" />
<field name="day_nb_id" ref="beesdoo_shift_daynumber_5_demo" />
<field name="task_type_id" ref="beesdoo_shift_task_type_1_demo" />
<field name="start_time">7</field>
<field name="end_time">9.5</field>
<field name="duration">2.5</field>
<field name="worker_nb">7</field>
<!-- WARNING: issue, worker not registered in demo -->
<field name="worker_ids" eval="[(6, 0, [ref('beesdoo_shift.res_partner_cooperator_6_demo')])]"/>
</record>
</odoo> </odoo>

3
beesdoo_shift_attendance/__manifest__.py

@ -21,6 +21,7 @@
'version': '12.0.1.0.0', 'version': '12.0.1.0.0',
'depends': [ 'depends': [
'beesdoo_base',
'beesdoo_shift', 'beesdoo_shift',
'beesdoo_worker_status', 'beesdoo_worker_status',
'mail', 'mail',
@ -39,6 +40,8 @@
"views/attendance_sheet.xml", "views/attendance_sheet.xml",
], ],
'demo': [ 'demo': [
"demo/tasks.xml",
"demo/workers.xml",
"demo/users.xml", "demo/users.xml",
] ]
} }

46
beesdoo_shift_attendance/demo/tasks.xml

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 Coop IT Easy
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="beesdoo_shift_attendance_task_template_1_demo" model="beesdoo.shift.template">
<field name="name">A_LUN_7:00-9:30</field>
<field name="planning_id" ref="beesdoo_shift.beesdoo_shift_planning_1_demo" />
<field name="day_nb_id" ref="beesdoo_shift.beesdoo_shift_daynumber_1_demo" />
<field name="task_type_id" ref="beesdoo_shift.beesdoo_shift_task_type_3_demo" />
<field name="start_time">7</field>
<field name="end_time">9.5</field>
<field name="duration">2.5</field>
<field name="worker_nb">12</field>
<field name="worker_ids" eval="[(6, 0, [ref('beesdoo_base.res_partner_cooperator_1_demo')])]"/>
</record>
<record id="beesdoo_shift_attendance_task_template_2_demo" model="beesdoo.shift.template">
<field name="name">A_MAR_12:00-14:30</field>
<field name="planning_id" ref="beesdoo_shift.beesdoo_shift_planning_1_demo" />
<field name="day_nb_id" ref="beesdoo_shift.beesdoo_shift_daynumber_2_demo" />
<field name="task_type_id" ref="beesdoo_shift.beesdoo_shift_task_type_2_demo" />
<field name="start_time">12</field>
<field name="end_time">14.5</field>
<field name="duration">2.5</field>
<field name="worker_nb">9</field>
<!-- WARNING: issue, worker not registered in demo -->
<field name="worker_ids" eval="[(6, 0, [ref('beesdoo_base.res_partner_cooperator_3_demo')])]"/>
</record>
<record id="beesdoo_shift_attendance_task_template_3_demo" model="beesdoo.shift.template">
<field name="name">A_VEN_7:00-9:30</field>
<field name="planning_id" ref="beesdoo_shift.beesdoo_shift_planning_1_demo" />
<field name="day_nb_id" ref="beesdoo_shift.beesdoo_shift_daynumber_5_demo" />
<field name="task_type_id" ref="beesdoo_shift.beesdoo_shift_task_type_1_demo" />
<field name="start_time">7</field>
<field name="end_time">9.5</field>
<field name="duration">2.5</field>
<field name="worker_nb">7</field>
<!-- WARNING: issue, worker not registered in demo -->
<field name="worker_ids" eval="[(6, 0, [ref('beesdoo_base.res_partner_cooperator_6_demo')])]"/>
</record>
</odoo>

12
beesdoo_shift/demo/workers.xml → beesdoo_shift_attendance/demo/workers.xml

@ -5,7 +5,7 @@
--> -->
<odoo> <odoo>
<record id="beesdoo_shift_cooperative_status_1_demo" model="cooperative.status"> <record id="beesdoo_shift_cooperative_status_1_demo" model="cooperative.status">
<field name="cooperator_id" ref="res_partner_cooperator_1_demo" />
<field name="cooperator_id" ref="beesdoo_base.res_partner_cooperator_1_demo" />
<field name="info_session" eval="True" /> <field name="info_session" eval="True" />
<field name="info_session_date" eval="datetime.now() - timedelta(days=58)" /> <field name="info_session_date" eval="datetime.now() - timedelta(days=58)" />
<field name="super" eval="True" /> <field name="super" eval="True" />
@ -14,7 +14,7 @@
</record> </record>
<record id="beesdoo_shift_cooperative_status_2_demo" model="cooperative.status"> <record id="beesdoo_shift_cooperative_status_2_demo" model="cooperative.status">
<field name="cooperator_id" ref="res_partner_cooperator_2_demo" />
<field name="cooperator_id" ref="beesdoo_base.res_partner_cooperator_2_demo" />
<field name="info_session" eval="False" /> <field name="info_session" eval="False" />
<field name="sr">2</field> <field name="sr">2</field>
<field name="working_mode">irregular</field> <field name="working_mode">irregular</field>
@ -22,7 +22,7 @@
</record> </record>
<record id="beesdoo_shift_cooperative_status_3_demo" model="cooperative.status"> <record id="beesdoo_shift_cooperative_status_3_demo" model="cooperative.status">
<field name="cooperator_id" ref="res_partner_cooperator_3_demo" />
<field name="cooperator_id" ref="beesdoo_base.res_partner_cooperator_3_demo" />
<field name="info_session" eval="True" /> <field name="info_session" eval="True" />
<field name="info_session_date" eval="datetime.now() - timedelta(days=98)" /> <field name="info_session_date" eval="datetime.now() - timedelta(days=98)" />
<field name="sc">2</field> <field name="sc">2</field>
@ -30,20 +30,20 @@
</record> </record>
<record id="beesdoo_shift_cooperative_status_4_demo" model="cooperative.status"> <record id="beesdoo_shift_cooperative_status_4_demo" model="cooperative.status">
<field name="cooperator_id" ref="res_partner_cooperator_4_demo" />
<field name="cooperator_id" ref="beesdoo_base.res_partner_cooperator_4_demo" />
<field name="sr">2</field> <field name="sr">2</field>
<field name="working_mode">irregular</field> <field name="working_mode">irregular</field>
<field name="irregular_start_date" eval="datetime.now() - timedelta(days=6)" /> <field name="irregular_start_date" eval="datetime.now() - timedelta(days=6)" />
</record> </record>
<record id="beesdoo_shift_cooperative_status_5_demo" model="cooperative.status"> <record id="beesdoo_shift_cooperative_status_5_demo" model="cooperative.status">
<field name="cooperator_id" ref="res_partner_cooperator_5_demo" />
<field name="cooperator_id" ref="beesdoo_base.res_partner_cooperator_5_demo" />
<field name="sr">2</field> <field name="sr">2</field>
<field name="working_mode">regular</field> <field name="working_mode">regular</field>
</record> </record>
<record id="beesdoo_shift_cooperative_status_6_demo" model="cooperative.status"> <record id="beesdoo_shift_cooperative_status_6_demo" model="cooperative.status">
<field name="cooperator_id" ref="res_partner_cooperator_6_demo" />
<field name="cooperator_id" ref="beesdoo_base.res_partner_cooperator_6_demo" />
<field name="info_session" eval="True" /> <field name="info_session" eval="True" />
<field name="info_session_date" eval="datetime.now() - timedelta(days=36)" /> <field name="info_session_date" eval="datetime.now() - timedelta(days=36)" />
<field name="sc">2</field> <field name="sc">2</field>

21
beesdoo_shift_attendance/tests/test_beesdoo_shift.py

@ -38,32 +38,35 @@ class TestBeesdooShift(TransactionCase):
) )
self.worker_regular_1 = self.env.ref( self.worker_regular_1 = self.env.ref(
"beesdoo_shift.res_partner_cooperator_6_demo"
"beesdoo_base.res_partner_cooperator_6_demo"
) )
self.worker_regular_2 = self.env.ref( self.worker_regular_2 = self.env.ref(
"beesdoo_shift.res_partner_cooperator_5_demo"
"beesdoo_base.res_partner_cooperator_5_demo"
) )
self.worker_regular_3 = self.env.ref( self.worker_regular_3 = self.env.ref(
"beesdoo_shift.res_partner_cooperator_3_demo"
"beesdoo_base.res_partner_cooperator_3_demo"
) )
self.worker_regular_super_1 = self.env.ref( self.worker_regular_super_1 = self.env.ref(
"beesdoo_shift.res_partner_cooperator_1_demo"
"beesdoo_base.res_partner_cooperator_1_demo"
) )
self.worker_irregular_1 = self.env.ref( self.worker_irregular_1 = self.env.ref(
"beesdoo_shift.res_partner_cooperator_2_demo"
"beesdoo_base.res_partner_cooperator_2_demo"
) )
self.worker_irregular_2 = self.env.ref( self.worker_irregular_2 = self.env.ref(
"beesdoo_shift.res_partner_cooperator_4_demo"
"beesdoo_base.res_partner_cooperator_4_demo"
) )
self.task_type_1 = self.env.ref( self.task_type_1 = self.env.ref(
"beesdoo_shift.beesdoo_shift_task_type_1_demo"
"beesdoo_shift_attendance"
".beesdoo_shift_attendance_task_type_1_demo"
) )
self.task_type_2 = self.env.ref( self.task_type_2 = self.env.ref(
"beesdoo_shift.beesdoo_shift_task_type_2_demo"
"beesdoo_shift_attendance"
".beesdoo_shift_attendance_task_type_2_demo"
) )
self.task_type_3 = self.env.ref( self.task_type_3 = self.env.ref(
"beesdoo_shift.beesdoo_shift_task_type_3_demo"
"beesdoo_shift_attendance"
".beesdoo_shift_attendance_task_type_3_demo"
) )
self.task_template_1 = self.env.ref( self.task_template_1 = self.env.ref(

Loading…
Cancel
Save