[MERGE] [IMP] hr_payroll: improved demo data and yml tests demo data

bzr revid: tde@openerp.com-20130904141110-svlfpvl3ddu12al7
This commit is contained in:
Thibault Delavallée 2013-09-04 16:11:10 +02:00
parent ed0a829cb3
commit 1a6eb52a32
4 changed files with 21 additions and 20 deletions

View File

@ -3,7 +3,7 @@
<data noupdate="1"> <data noupdate="1">
<record model="hr.holidays" id="hr_holidays_employee1_allocation_cl"> <record model="hr.holidays" id="hr_holidays_employee1_allocation_cl">
<field name="name">Casual Leave for Fabien Pinckaers</field> <field name="name">Casual Leave for Peter Parker</field>
<field name="holiday_status_id" ref="holiday_status_cl"/> <field name="holiday_status_id" ref="holiday_status_cl"/>
<field name="type">add</field> <field name="type">add</field>
<field name="number_of_days_temp">20</field> <field name="number_of_days_temp">20</field>

View File

@ -63,12 +63,12 @@
<field name="name">Provident Fund</field> <field name="name">Provident Fund</field>
</record> </record>
<record id="hr_salary_rule_ca_paolino" model="hr.salary.rule"> <record id="hr_salary_rule_ca_gravie" model="hr.salary.rule">
<field name="amount_select">fix</field> <field name="amount_select">fix</field>
<field eval="600.0" name="amount_fix"/> <field eval="600.0" name="amount_fix"/>
<field name="code">CAQP</field> <field name="code">CAGG</field>
<field name="category_id" ref="hr_payroll.ALW"/> <field name="category_id" ref="hr_payroll.ALW"/>
<field name="name">Conveyance Allowance For Paolino</field> <field name="name">Conveyance Allowance For Gravie</field>
<field name="sequence" eval="15"/> <field name="sequence" eval="15"/>
</record> </record>
@ -117,9 +117,9 @@
</record> </record>
<record id="structure_002" model="hr.payroll.structure"> <record id="structure_002" model="hr.payroll.structure">
<field name="code">MEQP</field> <field name="code">MEGG</field>
<field name="name">Marketing Executive for Quentin Paolino</field> <field name="name">Marketing Executive for Gilles Gravie</field>
<field eval="[(6, 0, [ref('hr_salary_rule_ca_paolino'), ref('hr_salary_rule_meal_voucher')])]" name="rule_ids"/> <field eval="[(6, 0, [ref('hr_salary_rule_ca_gravie'), ref('hr_salary_rule_meal_voucher')])]" name="rule_ids"/>
<field name="company_id" ref="base.main_company"/> <field name="company_id" ref="base.main_company"/>
<field name="parent_id" ref="structure_001"/> <field name="parent_id" ref="structure_001"/>
</record> </record>
@ -152,14 +152,14 @@
<field name="working_hours" ref="resource.timesheet_group1"/> <field name="working_hours" ref="resource.timesheet_group1"/>
</record> </record>
<record id="hr_contract_quentin_paolino" model="hr.contract"> <record id="hr_contract_gilles_gravie" model="hr.contract">
<field name="name">Contract For Quentin Paolino</field> <field name="name">Contract For Gilles Gravie</field>
<field name="type_id" ref="hr_contract.hr_contract_type_emp"/> <field name="type_id" ref="hr_contract.hr_contract_type_emp"/>
<field name="date_start" eval="time.strftime('%Y-%m')+'-1'"/> <field name="date_start" eval="time.strftime('%Y-%m')+'-1'"/>
<field name="date_end" eval="time.strftime('%Y')+'-12-31'"/> <field name="date_end" eval="time.strftime('%Y')+'-12-31'"/>
<field name="struct_id" ref="hr_payroll.structure_002"/> <field name="struct_id" ref="hr_payroll.structure_002"/>
<field name="employee_id" ref="hr.employee_qdp"/> <field name="employee_id" ref="hr.employee_qdp"/>
<field name="notes">This is Quentin Paolino's contract</field> <field name="notes">This is Gilles Gravie's contract</field>
<field eval="5000.0" name="wage"/> <field eval="5000.0" name="wage"/>
<field name="working_hours" ref="resource.timesheet_group1"/> <field name="working_hours" ref="resource.timesheet_group1"/>
</record> </record>

View File

@ -2,11 +2,11 @@
In order to test hr_timesheet Module in OpenERP, I make "Sign In/Sign Out for Project" to encode and In order to test hr_timesheet Module in OpenERP, I make "Sign In/Sign Out for Project" to encode and
track time spent on the different projects. track time spent on the different projects.
- -
I create employee "Quentin Paolino" as "User". I create employee "Gilles Gravie" as "User".
- -
!record {model: hr.employee, id: hr.employee_qdp}: !record {model: hr.employee, id: hr.employee_qdp}:
address_home_id: base.res_partner_address_8 address_home_id: base.res_partner_address_8
name: Quentin Paolino name: Gilles Gravie
parent_id: 'hr.employee_al' parent_id: 'hr.employee_al'
user_id: 'base.user_demo' user_id: 'base.user_demo'
- -
@ -22,7 +22,7 @@
!python {model: hr.sign.in.project}: | !python {model: hr.sign.in.project}: |
import time import time
uid = ref('base.user_demo') uid = ref('base.user_demo')
new_id = self.create(cr, uid, {'emp_id': ref('hr.employee_qdp'), 'name': 'Quentin Paolino', new_id = self.create(cr, uid, {'emp_id': ref('hr.employee_qdp'), 'name': 'Gilles Gravie',
'server_date': time.strftime('%Y-%m-%d %H:%M:%S')}) 'server_date': time.strftime('%Y-%m-%d %H:%M:%S')})
self.sign_in_result(cr, uid, [new_id], context) self.sign_in_result(cr, uid, [new_id], context)
- -
@ -35,7 +35,8 @@
new_id = self.create(cr, uid, {'account_id': ref('account.analytic_nebula'),'analytic_amount': 7.0, new_id = self.create(cr, uid, {'account_id': ref('account.analytic_nebula'),'analytic_amount': 7.0,
'date': (datetime.now()+timedelta(1)).strftime('%Y-%m-%d %H:%M:%S') , 'date': (datetime.now()+timedelta(1)).strftime('%Y-%m-%d %H:%M:%S') ,
'date_start': time.strftime('%Y-%m-%d %H:%M:%S'), 'info': 'Create Yaml for hr module', 'date_start': time.strftime('%Y-%m-%d %H:%M:%S'), 'info': 'Create Yaml for hr module',
'name': 'Quentin Paolino', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'present'}) 'name': 'Gilles Gravie', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'present'})
self.sign_out_result(cr, uid, [new_id], context) self.sign_out_result(cr, uid, [new_id], context)
- -
My work for this project "Sednacom" is over and I stop working by clicking on "Stop Work" button of this wizard. My work for this project "Sednacom" is over and I stop working by clicking on "Stop Work" button of this wizard.
@ -47,5 +48,5 @@
new_id = self.create(cr, uid, {'account_id': ref('account.analytic_spark'), 'analytic_amount': 7.0, new_id = self.create(cr, uid, {'account_id': ref('account.analytic_spark'), 'analytic_amount': 7.0,
'date': (datetime.now()+timedelta(2)).strftime('%Y-%m-%d %H:%M:%S'), 'date': (datetime.now()+timedelta(2)).strftime('%Y-%m-%d %H:%M:%S'),
'date_start': time.strftime('%Y-%m-%d %H:%M:%S'), 'info': 'Create Yaml for hr module', 'date_start': time.strftime('%Y-%m-%d %H:%M:%S'), 'info': 'Create Yaml for hr module',
'name': 'Quentin Paolino', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'absent'}) 'name': 'Gilles Gravie', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'absent'})
self.sign_out_result_end(cr, uid, [new_id], context) self.sign_out_result_end(cr, uid, [new_id], context)

View File

@ -7,29 +7,29 @@
!record {model: res.company, id: base.main_company}: !record {model: res.company, id: base.main_company}:
timesheet_max_difference: 1.00 timesheet_max_difference: 1.00
- -
I assign this product(Service on Timesheet) and journal(Timesheet Journal) to employee "Quentin Paolino" I assign this product(Service on Timesheet) and journal(Timesheet Journal) to employee "Gilles Gravie"
- -
!record {model: hr.employee, id: hr.employee_qdp}: !record {model: hr.employee, id: hr.employee_qdp}:
product_id: product.product_product_consultant product_id: product.product_product_consultant
journal_id: hr_timesheet.analytic_journal journal_id: hr_timesheet.analytic_journal
- -
I create a timesheet for employee "Quentin Paolino". I create a timesheet for employee "Gilles Gravie".
- -
!record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}: !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}:
date_from: !eval time.strftime('%Y-%m-01') date_from: !eval time.strftime('%Y-%m-01')
name: Quentin Paolino name: Gilles Gravie
state: new state: new
user_id: base.user_demo user_id: base.user_demo
employee_id: 'hr.employee_qdp' employee_id: 'hr.employee_qdp'
- -
Quentin "Sign In" at around 9am. Gilles "Sign In" at around 9am.
- -
!record {model: hr.attendance, id: hr_attendance_1}: !record {model: hr.attendance, id: hr_attendance_1}:
action: sign_in action: sign_in
employee_id: 'hr.employee_qdp' employee_id: 'hr.employee_qdp'
name: !eval datetime.now().strftime('%Y-%m-%d 09:%M:%S') name: !eval datetime.now().strftime('%Y-%m-%d 09:%M:%S')
- -
I test that Quentin in signed in I test that Gilles in signed in
- -
!assert {model: hr.employee, id: hr.employee_qdp}: !assert {model: hr.employee, id: hr.employee_qdp}:
- state == 'present' - state == 'present'