Browse Source

[FIX] beesdoo_shift: remove data dependency on beesdoo_base

pull/142/head
robin.keunen 5 years ago
parent
commit
2cce3ed00f
  1. 150
      beesdoo_shift/demo/workers.xml
  2. 16
      beesdoo_shift_attendance/tests/test_beesdoo_shift.py

150
beesdoo_shift/demo/workers.xml

@ -5,9 +5,105 @@
--> -->
<odoo> <odoo>
<record id="res_partner_worker_1_demo" model="res.partner">
<field name="name">Fernand Peso</field>
<field name="customer" eval="True"/>
<!-- <field name="eater">worker_eater</field>-->
<field name="is_company" eval="False"/>
<field name="email">fernand_peso@demode.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"/>
<!-- <field name="cooperative_status_ids"-->
<!-- eval="[(6, 0, [ref('beesdoo_shift.cooperative_status_1_demo')])]"/>-->
</record>
<record id="res_partner_worker_2_demo" model="res.partner">
<field name="name">Dupont Dupont</field>
<field name="customer" eval="True"/>
<!-- <field name="eater">worker_eater</field>-->
<field name="is_company" eval="False"/>
<field name="email">d_dupont@demode.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"/>
<!-- <field name="cooperative_status_ids"-->
<!-- eval="[(6, 0, [ref('beesdoo_shift.cooperative_status_2_demo')])]"/>-->
</record>
<record id="res_partner_worker_3_demo" model="res.partner">
<field name="name">Ronan Le Gall</field>
<field name="customer" eval="True"/>
<!-- <field name="eater">worker_eater</field>-->
<field name="is_company" eval="False"/>
<field name="email">ronan_gall@demode.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"/>
<!-- <field name="cooperative_status_ids"-->
<!-- eval="[(6, 0, [ref('beesdoo_shift.cooperative_status_3_demo')])]"/>-->
</record>
<record id="res_partner_worker_4_demo" model="res.partner">
<field name="name">Elouan Bees</field>
<field name="customer" eval="True"/>
<!-- <field name="eater">worker_eater</field>-->
<field name="is_company" eval="False"/>
<field name="email">elouan_bees@demode.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"/>
<!-- <field name="cooperative_status_ids"-->
<!-- eval="[(6, 0, [ref('beesdoo_shift.cooperative_status_4_demo')])]"/>-->
</record>
<record id="res_partner_worker_5_demo" model="res.partner">
<field name="name">Anne de Marchalo</field>
<field name="customer" eval="True"/>
<!-- <field name="eater">worker_eater</field>-->
<field name="is_company" eval="False"/>
<field name="email">anne_marchalo@demode.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"/>
<!-- <field name="cooperative_status_ids"-->
<!-- eval="[(6, 0, [ref('beesdoo_shift.cooperative_status_5_demo')])]"/>-->
</record>
<record id="res_partner_worker_6_demo" model="res.partner">
<field name="name">Jean Beaumont</field>
<field name="customer" eval="True"/>
<!-- <field name="eater">worker_eater</field>-->
<field name="is_company" eval="False"/>
<field name="email">jean_beaumont@demode.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"/>
<!-- <field name="cooperative_status_ids"-->
<!-- eval="[(6, 0, [ref('beesdoo_shift.cooperative_status_6_demo')])]"/>-->
</record>
<record id="cooperative_status_1_demo" model="cooperative.status"> <record id="cooperative_status_1_demo" model="cooperative.status">
<field name="cooperator_id" <field name="cooperator_id"
ref="beesdoo_base.res_partner_cooperator_1_demo"/>
ref="res_partner_worker_1_demo"/>
<field name="info_session" eval="True"/> <field name="info_session" eval="True"/>
<field name="info_session_date" <field name="info_session_date"
eval="datetime.now() - timedelta(days=58)"/> eval="datetime.now() - timedelta(days=58)"/>
@ -16,16 +112,9 @@
<field name="working_mode">regular</field> <field name="working_mode">regular</field>
</record> </record>
<record id="beesdoo_base.res_partner_cooperator_1_demo" model="res.partner">
<field name="working_mode">regular</field>
<field name="is_worker" eval="True"/>
<field name="cooperative_status_ids"
eval="[(6, 0, [ref('beesdoo_shift.cooperative_status_1_demo')])]"/>
</record>
<record id="cooperative_status_2_demo" model="cooperative.status"> <record id="cooperative_status_2_demo" model="cooperative.status">
<field name="cooperator_id" <field name="cooperator_id"
ref="beesdoo_base.res_partner_cooperator_2_demo"/>
ref="res_partner_worker_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>
@ -33,16 +122,9 @@
eval="datetime.now() - timedelta(days=3)"/> eval="datetime.now() - timedelta(days=3)"/>
</record> </record>
<record id="beesdoo_base.res_partner_cooperator_2_demo" model="res.partner">
<field name="working_mode">irregular</field>
<field name="is_worker" eval="True"/>
<field name="cooperative_status_ids"
eval="[(6, 0, [ref('beesdoo_shift.cooperative_status_2_demo')])]"/>
</record>
<record id="cooperative_status_3_demo" model="cooperative.status"> <record id="cooperative_status_3_demo" model="cooperative.status">
<field name="cooperator_id" <field name="cooperator_id"
ref="beesdoo_base.res_partner_cooperator_3_demo"/>
ref="res_partner_worker_3_demo"/>
<field name="info_session" eval="True"/> <field name="info_session" eval="True"/>
<field name="info_session_date" <field name="info_session_date"
eval="datetime.now() - timedelta(days=98)"/> eval="datetime.now() - timedelta(days=98)"/>
@ -50,46 +132,25 @@
<field name="working_mode">regular</field> <field name="working_mode">regular</field>
</record> </record>
<record id="beesdoo_base.res_partner_cooperator_3_demo" model="res.partner">
<field name="working_mode">regular</field>
<field name="is_worker" eval="True"/>
<field name="cooperative_status_ids"
eval="[(6, 0, [ref('beesdoo_shift.cooperative_status_3_demo')])]"/>
</record>
<record id="cooperative_status_4_demo" model="cooperative.status"> <record id="cooperative_status_4_demo" model="cooperative.status">
<field name="cooperator_id" <field name="cooperator_id"
ref="beesdoo_base.res_partner_cooperator_4_demo"/>
ref="res_partner_worker_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" <field name="irregular_start_date"
eval="datetime.now() - timedelta(days=6)"/> eval="datetime.now() - timedelta(days=6)"/>
</record> </record>
<record id="beesdoo_base.res_partner_cooperator_4_demo" model="res.partner">
<field name="working_mode">irregular</field>
<field name="is_worker" eval="True"/>
<field name="cooperative_status_ids"
eval="[(6, 0, [ref('beesdoo_shift.cooperative_status_4_demo')])]"/>
</record>
<record id="cooperative_status_5_demo" model="cooperative.status"> <record id="cooperative_status_5_demo" model="cooperative.status">
<field name="cooperator_id" <field name="cooperator_id"
ref="beesdoo_base.res_partner_cooperator_5_demo"/>
ref="res_partner_worker_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_base.res_partner_cooperator_5_demo" model="res.partner">
<field name="working_mode">regular</field>
<field name="is_worker" eval="True"/>
<field name="cooperative_status_ids"
eval="[(6, 0, [ref('beesdoo_shift.cooperative_status_5_demo')])]"/>
</record>
<record id="cooperative_status_6_demo" model="cooperative.status"> <record id="cooperative_status_6_demo" model="cooperative.status">
<field name="cooperator_id" <field name="cooperator_id"
ref="beesdoo_base.res_partner_cooperator_6_demo"/>
ref="res_partner_worker_6_demo"/>
<field name="info_session" eval="True"/> <field name="info_session" eval="True"/>
<field name="info_session_date" <field name="info_session_date"
eval="datetime.now() - timedelta(days=36)"/> eval="datetime.now() - timedelta(days=36)"/>
@ -97,11 +158,4 @@
<field name="working_mode">regular</field> <field name="working_mode">regular</field>
</record> </record>
<record id="beesdoo_base.res_partner_cooperator_6_demo" model="res.partner">
<field name="working_mode">regular</field>
<field name="is_worker" eval="True"/>
<field name="cooperative_status_ids"
eval="[(6, 0, [ref('beesdoo_shift.cooperative_status_6_demo')])]"/>
</record>
</odoo> </odoo>

16
beesdoo_shift_attendance/tests/test_beesdoo_shift.py

@ -39,22 +39,22 @@ class TestBeesdooShift(TransactionCase):
) )
self.worker_regular_1 = self.env.ref( self.worker_regular_1 = self.env.ref(
"beesdoo_base.res_partner_cooperator_6_demo"
"beesdoo_shift.res_partner_worker_6_demo"
) )
self.worker_regular_2 = self.env.ref( self.worker_regular_2 = self.env.ref(
"beesdoo_base.res_partner_cooperator_5_demo"
"beesdoo_shift.res_partner_worker_5_demo"
) )
self.worker_regular_3 = self.env.ref( self.worker_regular_3 = self.env.ref(
"beesdoo_base.res_partner_cooperator_3_demo"
"beesdoo_shift.res_partner_worker_3_demo"
) )
self.worker_regular_super_1 = self.env.ref( self.worker_regular_super_1 = self.env.ref(
"beesdoo_base.res_partner_cooperator_1_demo"
"beesdoo_shift.res_partner_worker_1_demo"
) )
self.worker_irregular_1 = self.env.ref( self.worker_irregular_1 = self.env.ref(
"beesdoo_base.res_partner_cooperator_2_demo"
"beesdoo_shift.res_partner_worker_2_demo"
) )
self.worker_irregular_2 = self.env.ref( self.worker_irregular_2 = self.env.ref(
"beesdoo_base.res_partner_cooperator_4_demo"
"beesdoo_shift.res_partner_worker_4_demo"
) )
self.task_type_1 = self.env.ref( self.task_type_1 = self.env.ref(
@ -68,10 +68,10 @@ class TestBeesdooShift(TransactionCase):
) )
self.task_template_1 = self.env.ref( self.task_template_1 = self.env.ref(
"beesdoo_worker_status" ".beesdoo_shift_task_template_1_demo"
"beesdoo_worker_status.beesdoo_shift_task_template_1_demo"
) )
self.task_template_2 = self.env.ref( self.task_template_2 = self.env.ref(
"beesdoo_worker_status" ".beesdoo_shift_task_template_2_demo"
"beesdoo_worker_status.beesdoo_shift_task_template_2_demo"
) )
# Set time in and out of generation interval parameter # Set time in and out of generation interval parameter

Loading…
Cancel
Save