[MERGE] improve tests on hr modules

bzr revid: rco@openerp.com-20111110164111-xrwdee76e192q18x
This commit is contained in:
Raphael Collet 2011-11-10 17:41:11 +01:00
commit 1896683037
10 changed files with 345 additions and 60 deletions

View File

@ -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,40 @@
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}: |
res = self.onchange_company(cr, uid, [ref('hr_employee_mark')], ref('base.main_company'), None)
values = dict([('company_id', ref('base.main_company'))] + res['value'].items())
self.write(cr, uid, [ref('hr_employee_mark')], values, 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']
values = dict([('department_id', ref('hr_department_rd0'))] + res['value'].items())
self.write(cr, uid, [ref('hr_employee_mark')], values, None)
-
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)
values = dict([('user_id', ref('hr_users_markjohnson0'))] + res['value'].items())
self.write(cr, uid, [ref('hr_employee_mark')], values, 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}:
@ -28,12 +58,20 @@
name: Phil Graves
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']
values = dict([('address_id', ref('base.res_partner_address_3000'))] + res['value'].items())
self.write(cr, uid, [ref('hr_employee_phil')], values, None)
-
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 +83,6 @@
-
!assert {model: hr.job, id: hr_job_jea0}:
- state == 'open'
-
I create Employee for job position.
-
@ -61,3 +98,43 @@
-
!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']
values = dict([('expected_employees', ref('hr_job_jea0'))] + res['value'].items())
self.write(cr, uid, [ref('hr_job_jea0')], values, None)
-
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

View File

@ -96,7 +96,13 @@
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)
values = dict([('evaluation_plan_id', ref('hr_evaluation_plan_managersplan0'))] + res['value'].items())
self.write(cr, uid, [ref('hr_employee_employee0')], values, None)
-
I create an Evaluation for employee under "Manager Evaluation Plan".
-
@ -106,18 +112,37 @@
plan_id: 'hr_evaluation_plan_managersplan0'
progress: 0.0
state: draft
-
I change the employee on Evaluation.
-
!python {model: hr_evaluation.evaluation}: |
res = self.onchange_employee_id(cr, uid, [ref('hr_evaluation_evaluation_0')], ref('hr_employee_employee0'), None)
values = dict([('employee_id', ref('hr_employee_employee0'))] + res['value'].items())
self.write(cr, uid, [ref('hr_evaluation_evaluation_0')], values, 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.
-
!python {model: hr_evaluation.evaluation}: |
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.
-

View File

@ -8,6 +8,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
@ -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)"
@ -63,6 +70,23 @@
-
!assert {model: hr.expense.expense, id: hr_expense_expense_september0}:
- state == 'draft'
-
I change the employee on expense form.
-
!python {model: hr.expense.expense}: |
res = self.onchange_employee_id(cr, uid, [ref('hr_expense_expense_september0')], ref('hr.employee1'), None)
values = dict([('employee_id', ref('hr.employee1'))] + res['value'].items())
self.write(cr, uid, [ref('hr_expense_expense_september0')], values, 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]
res = exp_line_obj.onchange_product_id(cr, uid, line_ids, ref('product_product_expense_air'), False, ref('hr.employee1'), None)
values = dict([('product_id', ref('product_product_expense_air'))] + res['value'].items())
exp_line_obj.write(cr, uid, line_ids, values, None)
-
I confirm this expenses by click on "Confirm" button.
-
@ -81,10 +105,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 +118,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"

View File

@ -42,18 +42,52 @@
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
date_from: !eval "'%s-05-20 13:59:00' %(datetime.now().year)"
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}: |
res = self.onchange_sec_id(cr, uid, [ref('hr_holidays_allocateleaveforuser0')], ref('holiday_status_sl'))
values = dict([('holiday_status_id', ref('holiday_status_sl'))] + res['value'].items())
self.write(cr, uid, [ref('hr_holidays_allocateleaveforuser0')], values, None)
-
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)
res = self.onchange_date_from(cr, uid, [ref('hr_holidays_allocateleaveforuser0')], date_to, date_from)
values = dict([('date_from', date_from),('date_to',date_to)] + res['value'].items())
self.write(cr, uid, [ref('hr_holidays_allocateleaveforuser0')], values, None)
-
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.
-
@ -68,7 +102,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'

View File

@ -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!')
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')]})

View File

@ -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)"
@ -50,14 +50,16 @@
employee_id: hr_employee_john
struct_id: hr_payroll_structure_softwaredeveloper
working_hours: resource.timesheet_group1
journal_id: account.expenses_journal
-
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
The selection of an employee fills the contract, structure, worked days and input data fields.
-
!python {model: hr.payslip}: |
import time
@ -71,25 +73,27 @@
'struct_id': res['value']['struct_id'],
'contract_id': res['value']['contract_id'],
'name': res['value']['name'],
}
}
vals['worked_days_line_ids'] = [(0,0,i) for i in res['value']['worked_days_line_ids']]
vals['input_line_ids'] = [(0,0,i) for i in res['value']['input_line_ids']]
res_contract = self.onchange_contract_id(cr, uid, [ref('hr_payslip_0')], date_from, date_to, ref('hr_employee_john'), ref('hr_contract_john'), None)
vals.update({'contract_id': ref('hr_contract_john')})
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 +101,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!')

View File

@ -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,38 @@
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}: |
res = self.onchange_job(cr, uid, [ref('hr_applicant_fresher0')], ref('hr.job_jr_developers'), None)
values = dict([('job_id', ref('hr.job_jr_developers'))] + res['value'].items())
res1 = self.onchange_department_id(cr, uid, [ref('hr_applicant_fresher0')], ref('hr.dep_it'), None)
values.update(dict([('department_id', ref('hr.dep_it'))] + res1['value'].items()))
self.write(cr, uid, [ref('hr_applicant_fresher0')], values, 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')]})

View File

@ -37,14 +37,6 @@
parent_id: 'hr_employee_employee0'
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".
-
@ -103,7 +95,26 @@
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)
res = self.on_change_date(cr, uid, [line_id], current_date)
values = dict([('date', current_date)] + res['value'].items())
res1 = self.on_change_user_id(cr, uid, [line_id], ref('base.user_root'))
values.update(dict([('user_id', ref('base.user_root'))] + res1['value'].items()))
self.write(cr, uid, [line_id], values, None)
-
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 +124,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 +146,4 @@
- |
I can see employee timesheet for particular month using "Employee Timesheet" report.

View File

@ -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.
-

View File

@ -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.
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))
!python {model: hr_timesheet_sheet.sheet}:
self.sign_in(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {})
-
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: