Ujjvala Collins (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-hr_yaml_coverage-uco into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-hr_yaml_coverage-uco/+merge/76727
[IMP] hr, hr_xxx:
------------------------------
* Improved all yamls in these modules. Added more test cases to improve
coverage ratio.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-hr_yaml_coverage-uco/+merge/76727
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-hr_yaml_coverage-uco.
=== modified file 'hr/test/test_hr.yml'
--- hr/test/test_hr.yml 2011-04-08 16:31:16 +0000
+++ hr/test/test_hr.yml 2011-09-23 12:42:33 +0000
@@ -1,13 +1,13 @@
-
- In order to test hr module in OpenERP, I will create new Employee , Department and Job Position.
+ In order to test hr module in OpenERP, I will create new Employee, Department and Job Position.
-
- I create "R&D Department" in Department form.
+ I create "R&D Department" in Department form.
-
!record {model: hr.department, id: hr_department_rd0}:
manager_id: base.user_root
name: 'R & D'
-
- Now, I create a new employee âMark Johnsonâ, and select department as "R&D Department".
+ Now, I create a new employee âMark Johnsonâ, and select department as âR&D Departmentâ.
-
!record {model: hr.employee, id: hr_employee_mark}:
address_home_id: base.res_partner_address_1
@@ -15,10 +15,34 @@
gender: male
marital: 'single'
name: Mark Johnson
- user_id: base.user_root
- department_id: 'hr_department_rd0'
--
- In order to check the wizard âEmployee Hierarchyâ , I will create new employee âPhil Graves â and select "Mark Johnson" as
+-
+ I change the company of the employee.
+-
+ !python {model: hr.employee}: |
+ self.onchange_company(cr, uid, [ref('hr_employee_mark')], ref('base.main_company'), None)
+-
+ I assign department for employee âMark Johnsonâ.
+-
+ !python {model: hr.employee}: |
+ res = self.onchange_department_id(cr, uid, [ref('hr_employee_mark')], ref('hr_department_rd0'), None)
+ assert res['value']['parent_id']
+-
+ Now I create a user for employee âMark Johnsonâ.
+-
+ !record {model: res.users, id: hr_users_markjohnson0}:
+ context_lang: en_US
+ groups_id:
+ - base.group_user
+ login: markjohnson
+ name: Mark Johnson
+ password: markjohnson
+-
+ I assign user to employee âMark Johnsonâ.
+-
+ !python {model: hr.employee}: |
+ res = self.onchange_user(cr, uid, [ref('hr_employee_mark')], ref('hr_users_markjohnson0'), None)
+-
+ In order to check the wizard âEmployee Hierarchyâ , I will create new employee âPhil Gravesâ and select âMark Johnsonâ as
Manager.
-
!record {model: hr.employee, id: hr_employee_phil}:
@@ -29,11 +53,17 @@
user_id: base.user_demo
parent_id: 'hr_employee_mark'
-
+ I fill the Working address for Employee.
+-
+ !python {model: hr.employee}: |
+ res = self.onchange_address_id(cr, uid, ref('hr_employee_phil'), ref('base.res_partner_address_3000'), None)
+ assert res['value']
+-
I will open up form view of âMark Johnsonâ and test the wizard âEmployee Hierarchyâ so it display the employee
hierarchy starting from âMark Johnsonâ.
-
- I will create new Job Position. I will check successfull creation of new Job Position by adding the information.
+ I will create new Job Position. I will check successful creation of new Job Position by adding the information.
-
!record {model: hr.job, id: hr_job_jea0}:
department_id: 'hr_department_rd0'
@@ -45,7 +75,6 @@
-
!assert {model: hr.job, id: hr_job_jea0}:
- state == 'open'
-
-
I create Employee for job position.
-
@@ -61,3 +90,41 @@
-
!assert {model: hr.job, id: hr_job_jea0}:
- no_of_employee != False
+-
+ As more requirements on the said job position are come, I increase the number of expected employees.
+-
+ !python {model: hr.job}: |
+ res = self.on_change_expected_employee(cr, uid, [ref('hr_job_jea0')], 6, 3, None)
+ assert res['value']['expected_employees']
+-
+ I open the job position for recruitment.
+-
+ !python {model: hr.job}: |
+ self.job_recruitement(cr, uid, [ref('hr_job_jea0')])
+-
+ I assign the job position to employee and mark the position.
+-
+ !python {model: hr.job}: |
+ self.job_open(cr, uid, [ref('hr_job_jea0')])
+-
+ Now the process is over so I don't want to use this position. I mark it as Old.
+-
+ !python {model: hr.job}: |
+ self.job_old(cr, uid, [ref('hr_job_jea0')])
+-
+ I create a parent category for the new recruited employees who are Freshers.
+-
+ !record {model: hr.employee.category, id: hr_employee_category_fresher0}:
+ name: Fresher
+-
+ I create another category for Junior Level freshers.
+-
+ !record {model: hr.employee.category, id: hr_employee_category_juniorlevel0}:
+ name: Junior Level
+ parent_id: hr_employee_category_fresher0
+-
+ I open the tree view of Categories and see the categories in a hierarchical manner.
+-
+ !python {model: hr.employee.category}: |
+ res = self.name_get(cr, uid, [ref('hr_employee_category_juniorlevel0')], None)
+ assert res
=== modified file 'hr_evaluation/test/test_hr_evaluation.yml'
--- hr_evaluation/test/test_hr_evaluation.yml 2011-07-12 13:46:15 +0000
+++ hr_evaluation/test/test_hr_evaluation.yml 2011-09-23 12:42:33 +0000
@@ -96,7 +96,11 @@
name: Final Interview with manager
sequence: 2
survey_id: 'survey_0'
-
+-
+ I assign the evaluation plan to the employee "Mark Johnson".
+-
+ !python {model: hr.employee}: |
+ res = self.onchange_evaluation_plan_id(cr, uid, [ref('hr_employee_employee0')], ref('hr_evaluation_plan_managersplan0'), False, None)
-
I create an Evaluation for employee under "Manager Evaluation Plan".
-
@@ -107,11 +111,22 @@
progress: 0.0
state: draft
-
+ I change the employee on Evaluation.
+-
+ !python {model: hr_evaluation.evaluation}: |
+ self.onchange_employee_id(cr, uid, [ref('hr_evaluation_evaluation_0')], ref('hr_employee_employee0'), None)
+-
I start the evaluation process by click on "Start Evaluation" button.
-
!python {model: hr_evaluation.evaluation}: |
self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')])
-
+-
+ I find a mistake on evaluation form. So I cancel the evaluation and again start it.
+-
+ !python {model: hr_evaluation.evaluation}: |
+ self.button_cancel(cr, uid, [ref('hr_evaluation_evaluation_0')])
+ self.button_draft(cr, uid, [ref('hr_evaluation_evaluation_0')])
+ self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')])
-
I close this survey request by giving answer of survey question.
-
@@ -119,6 +134,12 @@
evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0'))
self.pool.get('hr.evaluation.interview').survey_req_done(cr, uid, [r.id for r in evaluation.survey_request_ids])
-
+ I print the survey.
+-
+ !python {model: hr_evaluation.evaluation}: |
+ evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0'))
+ self.pool.get('hr.evaluation.interview').action_print_survey(cr, uid, [r.id for r in evaluation.survey_request_ids])
+-
I click on "Final Validation" button to finalise evaluation.
-
!python {model: hr_evaluation.evaluation}: |
=== modified file 'hr_expense/test/test_hr_expense.yml'
--- hr_expense/test/test_hr_expense.yml 2011-01-14 00:11:01 +0000
+++ hr_expense/test/test_hr_expense.yml 2011-09-23 12:42:33 +0000
@@ -9,6 +9,12 @@
-
I create a new employee.
-
+ !record {model: hr.employee, id: hr.employee}:
+ address_home_id: base.res_partner_address_1
+ address_id: base.main_address
+-
+ I assign home address to employee.
+-
!record {model: hr.employee, id: hr.employee1}:
address_home_id: base.res_partner_address_1
address_id: base.main_address
@@ -26,7 +32,6 @@
!record {model: product.product, id: product_product_travel0}:
categ_id: product.product_category_services
cost_method: standard
- hr_expense_ok: 1
list_price: 800.0
mes_type: fixed
name: Travel
@@ -40,15 +45,17 @@
warranty: 0.0
weight: 0.0
weight_net: 0.0
-
+-
+ I mark this product for expenses.
+-
+ !python {model: product.product}: |
+ self.on_change_hr_expense_ok(cr, uid, [ref('product_product_travel0')], True)
-
I create an expense.
-
!record {model: hr.expense.expense, id: hr_expense_expense_september0}:
company_id: base.main_company
- currency_id: base.EUR
date: !eval "'%s-05-05' %(datetime.now().year)"
- employee_id: hr.employee1
name: September Expenses
line_ids:
- date_value: !eval "'%s-05-27' %(datetime.now().year)"
@@ -64,6 +71,19 @@
!assert {model: hr.expense.expense, id: hr_expense_expense_september0}:
- state == 'draft'
-
+ I change the employee on expense form.
+-
+ !python {model: hr.expense.expense}: |
+ self.onchange_employee_id(cr, uid, [ref('hr_expense_expense_september0')], ref('hr.employee1'), None)
+-
+ Now I change the related product on expense line.
+-
+ !python {model: hr.expense.expense}: |
+ exp_line_obj = self.pool.get('hr.expense.line')
+ exp_obj = self.browse(cr, uid, ref('hr_expense_expense_september0'), None)
+ line_ids = [line.id for line in exp_obj.line_ids]
+ exp_line_obj.onchange_product_id(cr, uid, line_ids, ref('product_product_expense_air'), False, ref('hr.employee1'), None)
+-
I confirm this expenses by click on "Confirm" button.
-
!workflow {model: hr.expense.expense, action: confirm, ref: hr_expense_expense_september0}
@@ -81,10 +101,10 @@
-
I invoiced this expense by click on "Invoice" button.
-
- !workflow {model: hr.expense.expense, action: invoice, ref: hr_expense_expense_september0}
-
+ !python {model: hr.expense.expense}: |
+ self.invoice(cr, uid, [ref('hr_expense_expense_september0')], None)
-
- I check that state is "Invoiced"
+ I check that state is "Invoiced".
-
!assert {model: hr.expense.expense, id: hr_expense_expense_september0}:
- state == 'invoiced'
@@ -94,3 +114,4 @@
!python {model: hr.expense.expense}: |
exp = self.browse(cr, uid, [ref('hr_expense_expense_september0')])[0]
assert exp.invoice_id, "Invoice should be created"
+
=== modified file 'hr_holidays/test/test_hr_holiday.yml'
--- hr_holidays/test/test_hr_holiday.yml 2011-01-14 00:11:01 +0000
+++ hr_holidays/test/test_hr_holiday.yml 2011-09-23 12:42:33 +0000
@@ -42,7 +42,6 @@
I allocate leave request for employee "Phil Graves".
-
!record {model: hr.holidays, id: hr_holidays_allocateleaveforuser0}:
- employee_id: 'hr_employee_philgraves0'
holiday_status_id: hr_holidays_status_sick0
name: Sick Leaves for Phil Graves
number_of_days_temp: 12.0
@@ -50,11 +49,42 @@
date_to: !eval "'%s-05-22 13:59:00' %(datetime.now().year)"
type: add
-
+ I assign allocation type as 'Employee'.
+-
+ !python {model: hr.holidays}: |
+ self.onchange_type(cr, uid, [ref('hr_holidays_allocateleaveforuser0')], 'employee')
+-
+ I change Leave Type of the employee.
+-
+ !python {model: hr.holidays}: |
+ self.onchange_sec_id(cr, uid, [ref('hr_holidays_allocateleaveforuser0')], ref('holiday_status_sl'))
+-
+ I assign the dates in the holiday request.
+-
+ !python {model: hr.holidays}: |
+ from datetime import datetime
+ date_from = '%s-%s-%s 14:00:00' %(datetime.now().year, datetime.now().month, datetime.now().day)
+ date_to = '%s-%s-%s 19:59:00' %(datetime.now().year, datetime.now().month, datetime.now().day)
+ self.onchange_date_from(cr, uid, [ref('hr_holidays_allocateleaveforuser0')], date_to, date_from)
+-
I confirmed the allocation by clicking on "Confirm" button.
-
!workflow {model: hr.holidays, action: confirm, ref: hr_holidays_allocateleaveforuser0}
-
+ I find a small mistake on my leave request to I refuse the leave request to correct a mistake.
+-
+ !workflow {model: hr.holidays, action: refuse, ref: hr_holidays_allocateleaveforuser0}
+
+-
+ I again set to draft and then confirm.
+-
+ !python {model: hr.holidays}: |
+ import netsvc
+ wf_service = netsvc.LocalService("workflow")
+ self.set_to_draft(cr, uid, [ref('hr_holidays_allocateleaveforuser0')])
+ wf_service.trg_validate(uid, 'hr.holidays', ref('hr_holidays_allocateleaveforuser0'), 'confirm', cr)
+-
I validate the allocation by clicking on "To Approve" button.
-
!workflow {model: hr.holidays, action: validate, ref: hr_holidays_allocateleaveforuser0}
@@ -68,7 +98,7 @@
employee_id: 'hr_employee_philgraves0'
holiday_status_id: 'hr_holidays_status_sick0'
name: Appointment with Doctor
- notes: My appointment with the doctor is confirmed. so please accept my leave.
+ notes: My appointment with the doctor is confirmed. So please accept my leave.
number_of_days_temp: 2.0
type: remove
user_id: 'test_holiday_user1'
=== modified file 'hr_payroll/test/payslip.yml'
--- hr_payroll/test/payslip.yml 2011-07-11 10:27:54 +0000
+++ hr_payroll/test/payslip.yml 2011-09-23 12:42:33 +0000
@@ -16,7 +16,6 @@
name: Salary Structure for Software Developer
code: SD
company_id: base.main_company
- parent_id: structure_base
rule_ids:
- hr_salary_rule_houserentallowance1
- hr_salary_rule_convanceallowance1
@@ -91,4 +90,46 @@
!python {model: hr.payslip}: |
from tools.translate import _
payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
- assert(payslip_brw.state == 'done'), _('State not changed!')
\ No newline at end of file
+ assert(payslip_brw.state == 'done'), _('State not changed!')
+-
+ I want to check refund payslip so I click on refund button.
+-
+ !python {model: hr.payslip}: |
+ self.refund_sheet(cr, uid, [ref("hr_payslip_0")], None)
+-
+ I check on new payslip Credit Note is checked or not.
+-
+ !python {model: hr.payslip}: |
+ payslip_obj = self.browse(cr, uid, ref("hr_payslip_0"), None)
+ payslip_ids = self.search(cr, uid, [('name','like','Refund: '+payslip_obj.name),('credit_note','=',True)], None)
+ assert payslip_ids, "Payslip not refunded!"
+-
+ I want to generate a payslip from Payslip run.
+-
+ !record {model: hr.payslip.run, id: hr_payslip_run_PayslipforEmployee0}:
+ date_end: '2011-09-30'
+ date_start: '2011-09-01'
+ name: Payslip for Employee
+-
+ I create record for generating the payslip for this Payslip run.
+-
+ !record {model: hr.payslip.employees, id: hr_payslip_employees0}:
+ employee_ids:
+ - hr_employee_richard0
+-
+ I generate the payslip by clicking on Generat button wizard.
+-
+ !python {model: hr.payslip.employees}: |
+ self.compute_sheet(cr, uid, [ref('hr_payslip_employees0')], context={'active_id': ref('hr_payslip_run_PayslipforEmployee0')})
+-
+ I open Contribution Register and from there I print the Payslip Lines report.
+-
+ !record {model: payslip.lines.contribution.register, id: payslip_lines_contribution_register0}:
+ date_from: '2011-09-30'
+ date_to: '2011-09-01'
+-
+ I print the report.
+-
+ !python {model: payslip.lines.contribution.register}: |
+ self.print_report(cr, uid, [ref('payslip_lines_contribution_register0')], context={'active_ids': [ref('hr_houserent_register')]})
+
=== modified file 'hr_payroll_account/test/hr_payroll_account.yml'
--- hr_payroll_account/test/hr_payroll_account.yml 2011-08-15 23:06:37 +0000
+++ hr_payroll_account/test/hr_payroll_account.yml 2011-09-23 12:42:33 +0000
@@ -1,7 +1,7 @@
-
- I test the "Payslip" in order to check the hr_payroll_account module in OpenERP
+ I test the "Payslip" in order to check the hr_payroll_account module in OpenERP.
-
- I create a bank record
+ I create a bank record.
-
!record {model: res.partner.bank, id: res_partner_bank_0}:
acc_number: '001-9876543-21'
@@ -9,7 +9,7 @@
state: bank
bank: base.res_bank_1
-
- I create a new employee "John"
+ I create a new employee "John".
-
!record {model: hr.employee, id: hr_employee_john}:
address_home_id: base.res_partner_address_2
@@ -24,7 +24,7 @@
bank_account_id: res_partner_bank_0
vehicle_distance: 0.0
-
- I create a salary structure for 'Software Developer'
+ I create a salary structure for 'Software Developer'.
-
!record {model: hr.payroll.structure, id: hr_payroll_structure_softwaredeveloper}:
name: Salary Structure for Software Developer
@@ -39,7 +39,7 @@
- hr_payroll.hr_salary_rule_meal_voucher
- hr_payroll.hr_salary_rule_sales_commission
-
- I create a contract for "John"
+ I create a contract for "John".
-
!record {model: hr.contract, id: hr_contract_john}:
date_end: !eval "'%s-%s-%s' %(datetime.now().year+1,datetime.now().month,datetime.now().day)"
@@ -51,13 +51,22 @@
struct_id: hr_payroll_structure_softwaredeveloper
working_hours: resource.timesheet_group1
-
- I create a Payslip
+ I create a Payslip.
-
!record {model: hr.payslip, id: hr_payslip_0}:
employee_id: hr_employee_john
journal_id: account.expenses_journal
-
- The selection of an employee fills the contract, structure, worked days and input data fields
+ I assign contract in the payslip.
+-
+ !python {model: hr.payslip}: |
+ import time
+ from datetime import datetime
+ date_from = '%s-%s-%s' %(datetime.now().year+1,datetime.now().month,datetime.now().day)
+ date_to = time.strftime('%Y-%m-%d')
+ self.onchange_contract_id(cr, uid, [ref('hr_payslip_0')], date_from, date_to, ref('hr_employee_john'), ref('hr_contract_john'), None)
+-
+ The selection of an employee fills the contract, structure, worked days and input data fields.
-
!python {model: hr.payslip}: |
import time
@@ -76,20 +85,20 @@
vals['input_line_ids'] = [(0,0,i) for i in res['value']['input_line_ids']]
self.write(cr, uid, ref("hr_payslip_0"), vals)
-
- I assign the amount to Input data
+ I assign the amount to Input data.
-
!python {model: hr.payslip.input}: |
ids = self.search(cr, uid, [('payslip_id', '=', ref("hr_payslip_0"))])
self.write(cr, uid, ids, {'amount': 5.0})
-
- I verify the payslip is in draft state
+ I verify the payslip is in draft state.
-
!python {model: hr.payslip}: |
from tools.translate import _
payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
assert(payslip_brw.state == 'draft'), _('State not changed!')
-
- I click on "Compute Sheet" button
+ I click on "Compute Sheet" button.
-
!python {model: hr.payslip}: |
self.compute_sheet(cr, uid, [ref("hr_payslip_0")], {"lang": "en_US", "tz": False,
@@ -97,19 +106,28 @@
"section_id": False, "active_id": ref("hr_payroll.menu_department_tree"),
})
-
- Then I click on the "Confirm" button
+ I want to check cancel button. So I first cancel the sheet then make it set to draft.
+-
+ !python {model: hr.payslip}: |
+ import netsvc
+ wf_service = netsvc.LocalService("workflow")
+ self.cancel_sheet(cr, uid, [ref("hr_payslip_0")], None)
+ wf_service.trg_validate(uid, 'hr.payslip', ref("hr_payslip_0"), 'draft', cr)
+-
+ Then I click on the "Confirm" button.
-
!workflow {model: hr.payslip, action: hr_verify_sheet, ref: hr_payslip_0}
-
- I verify that the Accounting Entries are created
+ I verify that the Accounting Entries are created.
-
!python {model: hr.payslip}: |
payslip = self.browse(cr, uid, ref("hr_payslip_0"))
assert payslip.move_id, "Accounting Entries has not been created"
-
- I verify that the payslip is in done state
+ I verify that the payslip is in done state.
-
!python {model: hr.payslip}: |
from tools.translate import _
payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
assert(payslip_brw.state == 'done'), _('State not changed!')
+
=== modified file 'hr_recruitment/test/test_hr_recruitment.yml'
--- hr_recruitment/test/test_hr_recruitment.yml 2011-04-07 09:27:30 +0000
+++ hr_recruitment/test/test_hr_recruitment.yml 2011-09-23 12:42:33 +0000
@@ -52,7 +52,12 @@
!python {model: hr.applicant}: |
self.case_open(cr, uid, [ref("hr_applicant_fresher0")], {"active_ids": [ref("hr_recruitment.menu_crm_case_categ0_act_job")],
})
-
+-
+ I change the stages by clicking on stage next and stage previous buttons.
+-
+ !python {model: hr.applicant}: |
+ self.stage_next(cr, uid, [ref('hr_applicant_fresher0')], None)
+ self.stage_previous(cr, uid, [ref('hr_applicant_fresher0')], None)
-
I create a new case category.
-
@@ -97,14 +102,35 @@
rrule_type: none
state: open
user_id: base.user_root
-
+-
+ I print the survery filled up by the applicant.
+-
+ !python {model: hr.applicant}: |
+ self.action_print_survey(cr, uid, [ref('hr_applicant_fresher0')], None)
+-
+ I assign the position to the applicant and its relevant department.
+-
+ !python {model: hr.applicant}: |
+ self.onchange_job(cr, uid, [ref('hr_applicant_fresher0')], ref('hr.job_jr_developers'), None)
+ self.onchange_department_id(cr, uid, [ref('hr_applicant_fresher0')], ref('hr.dep_it'), None)
-
On a successful meeting with the applicant, I hired employee by click on "Hired" button.
-
- !python {model: hr.applicant}: |
- self.case_close(cr, uid, [ref('hr_applicant_fresher0')])
+ !python {model: hired.employee}: |
+ self.case_close(cr, uid, [], context={'active_ids': [ref('hr_applicant_fresher0')]})
-
I check that applicant state is "Hired".
-
!assert {model: hr.applicant, id: hr_applicant_fresher0}:
- state == 'done'
+-
+ I create partner for the hired applicant for accounting purpose.
+-
+ !record {model: hr.recruitment.partner.create, id: hr_recruitment_partner_create0}:
+ close: False
+-
+ I click on Create Partner button to create a partner for applicant.
+-
+ !python {model: hr.recruitment.partner.create}: |
+ self.make_order(cr, uid, [ref('hr_recruitment_partner_create0')], context={'active_ids': [ref('hr_applicant_fresher0')]})
+
=== modified file 'hr_timesheet/test/test_hr_timesheet.yml'
--- hr_timesheet/test/test_hr_timesheet.yml 2011-07-12 12:07:48 +0000
+++ hr_timesheet/test/test_hr_timesheet.yml 2011-09-23 12:42:33 +0000
@@ -38,14 +38,6 @@
user_id: 'test_timesheet_user1'
-
- I create Timesheet journal for employee.
--
- !record {model: account.analytic.journal, id: analytic_journal}:
- code: TS
- name: Timesheet Journal
- type: general
-
--
I create a product as "Consultancy - Senior Developer".
-
!record {model: product.product, id: product_consultant}:
@@ -103,7 +95,23 @@
uid = ref('test_timesheet_user1')
new_id = self.create(cr, uid, {'emp_id': ref('hr_employee_fracline1'), 'name': 'Francline', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'absent'})
self.sign_in_result(cr, uid, [new_id], context)
-
+-
+ I create a timesheet line manually to check several default values.
+ I also assign proper date and user for that line.
+-
+ !python {model: hr.analytic.timesheet}: |
+ import time
+ uid = ref('test_timesheet_user1')
+ current_date = time.strftime('%Y-%m-%d')
+ vals = {'name': 'Worked on project',
+ 'user_id': ref('test_timesheet_user1'),
+ 'account_id': ref('account.analytic_project_1_development'),
+ 'unit_amount': 5.00,
+ 'journal_id': ref('analytic_journal')
+ }
+ line_id = self.create(cr, uid, vals, None)
+ self.on_change_date(cr, uid, [line_id], current_date)
+ self.on_change_user_id(cr, uid, [line_id], ref('base.user_root'))
-
To stop work I click on "Sign In/Sign Out" button of "Sign In/Sign Out by Project" wizard.
Which check state in hr attendace form for user.
@@ -113,7 +121,6 @@
ids = self.search(cr, uid, [('emp_id', '=', ref('hr_employee_fracline1')),('name', '=', 'Francline')])
self.check_state(cr, uid, ids, {"active_ids": [ref("hr_timesheet.action_hr_timesheet_sign_in")]
})
-
-
I Create an analytic account "Project2".
-
@@ -136,3 +143,4 @@
- |
I can see employee timesheet for particular month using "Employee Timesheet" report.
+
=== modified file 'hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml'
--- hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml 2011-05-03 13:00:24 +0000
+++ hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml 2011-09-23 12:42:33 +0000
@@ -23,7 +23,17 @@
!record {model: account.analytic.account, id: account.analytic_sednacom}:
partner_id: base.res_partner_desertic_hispafuentes
pricelist_id: product.list0
-
+-
+ I open this account and make the state as pending.
+-
+ !python {model: account.analytic.account}: |
+ self.set_open(cr, uid, [ref('account.analytic_sednacom')], None)
+ self.set_pending(cr, uid, [ref('account.analytic_sednacom')], None)
+-
+ I assign account on analytic account line.
+-
+ !python {model: hr.analytic.timesheet}: |
+ self.on_change_account_id(cr, uid, [ref('account_analytic_line_developyamlforhrmodule0')], ref('account.analytic_sednacom'))
-
I create invoice on analytic Line using "Invoice analytic Line" wizard.
-
@@ -73,11 +83,15 @@
price: 1
time: 1
-
- I click on "Create Invoice" button to create Invoice.
+ I click on "Create Invoice" button to create Invoice and validate the invoice.
-
!python {model: hr.timesheet.invoice.create.final}: |
- self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_final_0")], {"active_ids": [ref("account.analytic_sednacom")]})
-
+ import netsvc
+ wkf_service = netsvc.LocalService("workflow")
+ res = self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_final_0")], {"active_ids": [ref("account.analytic_sednacom")]})
+ invoice_ids = eval(res['domain'])[0][2]
+ for inv in invoice_ids:
+ wkf_service.trg_validate(uid, 'account.invoice', inv, 'invoice_open', cr)
-
I can also make some theoretical revenue reports.
-
=== modified file 'hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml'
--- hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml 2011-07-18 11:03:50 +0000
+++ hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml 2011-09-23 12:42:33 +0000
@@ -71,13 +71,30 @@
user_id: base.user_demo
employee_id: 'hr_employee_employee0'
-
- Now , at the time of login, I create Attendances and perform "Sign In" action.
--
- !record {model: hr.attendance, id: hr_attendance_0}:
- action: sign_in
- employee_id: 'hr_employee_employee0'
- name: !eval time.strftime('%Y-%m-%d')+' '+'%s:%s:%s' %(max(0,datetime.now().hour-1),max(0,datetime.now().minute-1),max(0,datetime.now().second-1))
-
+ Now, at the time of login, I create Attendances and perform "Sign In" action.
+-
+ !python {model: hr_timesheet_sheet.sheet}:
+ self.sign_in(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], None)
+-
+ I want to check attendance and work of yesterday. I click on <- button.
+-
+ !python {model: hr_timesheet_sheet.sheet}: |
+ self.date_previous(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], None)
+-
+ Then I click on "Today" button to fill today's timesheet.
+-
+ !python {model: hr_timesheet_sheet.sheet}: |
+ self.date_today(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], None)
+-
+ I want to go to a particular date and see attendance then I select the date and click on "Go to:" button.
+-
+ !python {model: hr_timesheet_sheet.sheet}: |
+ self.button_dummy(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], None)
+-
+ I can also move to next day by clicking on -> button.
+-
+ !python {model: hr_timesheet_sheet.sheet}: |
+ self.date_next(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], None)
-
At the time of logout, I create attendance and perform "Sign Out".
-
@@ -88,7 +105,6 @@
-
I create Timesheet Entry for time spend on today work.
-
-
!record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}:
timesheet_ids:
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp