-
  I test the 'Payment Advice' in order to check the hr_payroll in OpenERP
-
  I create a new employee “Richie”
-
  !record {model: hr.employee, id: hr_employee_richie0}:
    address_home_id: base.res_partner_address_1
    address_id: base.res_partner_address_9
    birthday: '1984-05-01'
    children: 0.0
    contract_ids:
      - advantages_gross: 0.0
        advantages_net: 0.0
        date_end: '2011-07-01'
        date_start: '2010-07-01'
        name: reference
        wage: 5000.0
        wage_type_id: hr_contract.hr_contract_monthly_gross
        type_id: hr_contract.hr_contract_type_emp
    country_id: base.in
    department_id: hr.dep_it
    employee_account: account.a_recv
    gender: male
    marital: hr.hr_employee_marital_status_single
    name: Richie
    pg_joining: '2009-12-01'
    property_bank_account: account.cash
    salary_account: account.a_recv
    vehicle_distance: 0.0
-
  I create a new payment advice record
-
  !record {model: hr.payroll.advice, id: hr_payroll_advice_advice0}:
    account_id: account.cash
    line_ids:
      - amount: 5500.0
        bysal: 5000.0
        employee_id: 'hr_employee_richie0'
        flag: C
        name: Axis Bank
    name: advice1
-
  I confirmed the sheet by click on "Confirm Sheet" button.
-
  !python {model: hr.payroll.advice}: |
    self.confirm_sheet(cr, uid, [ref("hr_payroll_advice_advice0")], {"lang": "en_US",
      "active_model": "ir.ui.menu", "active_ids": [ref("hr_payroll.hr_menu_payment_advice")],
      "tz": False, "active_id": ref("hr_payroll.hr_menu_payment_advice")})
-
 I check that a state is "Confirm"
-
  !python {model: hr.payroll.advice}: |
    from tools.translate import _
    advice_id=self.browse(cr, uid, ref("hr_payroll_advice_advice0"))
    assert(advice_id.state == 'confirm'), _('State not changed!')

-
  Print Payroll Advice
- 
  !python {model: hr.payroll.advice}: |
    import netsvc, tools, os
    (data, format) = netsvc.LocalService('report.payroll.advice').create(cr, uid, [ref('hr_payroll_advice_advice0')], {}, {})
    if tools.config['test_report_directory']:
       file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-payroll-advice.'+format), 'wb+').write(data)
