[MERGE] l10n_in_hr_payroll: Payment Advice batch yaml fix

hr_payroll_account: Add default journal on Payslip run

bzr revid: mra@tinyerp.com-20120817052701-wiyh2mtrrvwix2mw
This commit is contained in:
Mustufa Rangwala (OpenERP) 2012-08-17 10:57:01 +05:30
commit 53a5c05569
2 changed files with 33 additions and 6 deletions

View File

@ -218,6 +218,17 @@ class hr_payslip_run(osv.osv):
'journal_id': fields.many2one('account.journal', 'Expense Journal', states={'draft': [('readonly', False)]}, readonly=True, required=True),
}
def _get_default_journal(self, cr, uid, context=None):
model_data = self.pool.get('ir.model.data')
res = model_data.search(cr, uid, [('name', '=', 'expenses_journal')])
if res:
return model_data.browse(cr, uid, res[0]).res_id
return False
_defaults = {
'journal_id': _get_default_journal,
}
hr_payslip_run()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,18 +1,34 @@
-
In order to test Payment Advice creation from Payslip Bacth I create New Payslip Batch
In order to test Payment Advice Creation from Payslip Bacth I create New Payslip Batch
-
I Create a bank record
-
!record {model: res.partner.bank, id: res_partner_bank_0}:
acc_number: '3025632343043'
partner_id: base.res_partner_21
state: bank
bank: base.res_bank_1
-
I create a new employee “Rahul”
-
!record {model: hr.employee, id: hr_employee_rahul0}:
country_id: base.in
department_id: hr.dep_rd
name: Rahul
bank_account_id: res_partner_bank_0
-
I want to generate a payslip from Payslip Batch.
-
!record {model: hr.payslip.run, id: hr_payslip_run_forAdvice}:
name: Payslip Batch for August
name: Payslip Batch
-
I create record for generating the payslip for this Payslip Batch.
I create record for generating the Payslip for Payslip Batch.
-
!record {model: hr.payslip.employees, id: hr_payslip_employees}:
employee_ids:
- hr.employee_qdp
- hr_employee_rahul0
-
I generate the payslip by clicking on Generat button wizard.
I generate the payslip by clicking on Generate button wizard.
-
!python {model: hr.payslip.employees}: |
self.compute_sheet(cr, uid, [ref('hr_payslip_employees')], context={'active_id': ref('hr_payslip_run_forAdvice')})
@ -33,7 +49,7 @@
batch = self.browse(cr, uid, ref("hr_payslip_run_forAdvice"))
assert (batch.state == 'close')
-
I Create Advice from Payslip Batch using Create Advice button
I create Advice from Payslip Batch using Create Advice button
-
!python {model: hr.payslip.run}: |
self.create_advice(cr, uid, [ref('hr_payslip_run_forAdvice')])