From a6e272a5e71394ce9d8d0841a2b7de2e6cd5c2af Mon Sep 17 00:00:00 2001 From: Digvijay Singh Date: Wed, 25 Jul 2012 16:35:20 +0530 Subject: [PATCH 1/5] [IMP]l10n_in_hr_payroll: add yaml file for payment advice bzr revid: dsi@tinyerp.com-20120725110520-w3rmgy0kbwa5kmdg --- addons/l10n_in_hr_payroll/__openerp__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/l10n_in_hr_payroll/__openerp__.py b/addons/l10n_in_hr_payroll/__openerp__.py index 41df9e24889..38085ada54c 100644 --- a/addons/l10n_in_hr_payroll/__openerp__.py +++ b/addons/l10n_in_hr_payroll/__openerp__.py @@ -53,6 +53,7 @@ Indian Payroll Salary Rules. 'report/payment_advice_report_view.xml', ], 'demo_xml': ['l10n_in_hr_payroll_demo.xml'], + 'test': ['test/payment_advice.yml'], 'installable': True } From bf015bbf361d8da00c1dcdc5c9b28ede95b876a5 Mon Sep 17 00:00:00 2001 From: Digvijay Singh Date: Wed, 25 Jul 2012 16:44:51 +0530 Subject: [PATCH 2/5] [IMP]l10n_in_hr_payroll: add yaml file for payment advice bzr revid: dsi@tinyerp.com-20120725111451-k7sfc5rj73njvdgr --- .../test/payment_advice.yml | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 addons/l10n_in_hr_payroll/test/payment_advice.yml diff --git a/addons/l10n_in_hr_payroll/test/payment_advice.yml b/addons/l10n_in_hr_payroll/test/payment_advice.yml new file mode 100644 index 00000000000..790b8bd46a5 --- /dev/null +++ b/addons/l10n_in_hr_payroll/test/payment_advice.yml @@ -0,0 +1,56 @@ +- + import time +- + I create a new Payment Advice For Month june and july +- + !record {model: hr.payroll.advice, id: payment_advice_1}: + name: 'June' + date: !eval time.strftime( "%Y-%m-%d" ) + bank_id: 'base.res_bank_1' + chaque_nos: '007667' + line_ids: + - employee_id: 'hr.employee_fp' + name: '90125452' + ifsc_code: 'abn45215145' + bysal: '25000' + debit_credit: 'C' + - employee_id: 'hr.employee_al' + name: '00014521111232' + ifsc_code: 'sbi45452145' + bysal: '20000' + debit_credit: 'C' +- + !record {model: hr.payroll.advice, id: payment_advice_2}: + name: 'July' + date: !eval time.strftime( "%Y-%m-%d" ) + chaque_nos: '007568' + line_ids: + - employee_id: 'hr.employee_fp' + name: '90125452' + bysal: '25000' + debit_credit: 'C' + - employee_id: 'hr.employee_al' + name: '00014521111232' + bysal: '20000' + debit_credit: 'C' +- + I check my payment order state is Confirmed +- + !assert {model: hr.payroll.advice, id: payment_advice_1, string: state is confirmed}: + - state == 'draft' +- + In order to test the PDF reports defined on a Payment Advice,we will print a Payment Advice Detail Summary Report when NEFT is checked +- + !python {model: hr.payroll.advice}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.payroll.advice').create(cr, uid, [ref('l10n_in_hr_payroll.payment_advice_1')], {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'l10n_in_hr_payroll_summary report'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on a Payment Advice,we will print a Payment Advice Detail Summary Report when NEFT is Not checked +- + !python {model: hr.payroll.advice}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.payroll.advice').create(cr, uid, [ref('l10n_in_hr_payroll.payment_advice_2')], {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'l10n_in_hr_payroll_summary report'+format), 'wb+').write(data) From 2c8c4e3becc86d217300d816f4c067e51b64540b Mon Sep 17 00:00:00 2001 From: Digvijay Singh Date: Thu, 26 Jul 2012 10:35:18 +0530 Subject: [PATCH 3/5] [IMP]l10n_in_hr_payroll: add yaml file for payment advice bzr revid: dsi@tinyerp.com-20120726050518-ew9n44q0fs4vfze1 --- addons/l10n_in_hr_payroll/test/payment_advice.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/l10n_in_hr_payroll/test/payment_advice.yml b/addons/l10n_in_hr_payroll/test/payment_advice.yml index 790b8bd46a5..033b276c40d 100644 --- a/addons/l10n_in_hr_payroll/test/payment_advice.yml +++ b/addons/l10n_in_hr_payroll/test/payment_advice.yml @@ -1,11 +1,11 @@ - - import time + import datetime - I create a new Payment Advice For Month june and july - !record {model: hr.payroll.advice, id: payment_advice_1}: name: 'June' - date: !eval time.strftime( "%Y-%m-%d" ) + date: !eval "'%s-06-01' %(datetime.now().year)" bank_id: 'base.res_bank_1' chaque_nos: '007667' line_ids: @@ -22,7 +22,7 @@ - !record {model: hr.payroll.advice, id: payment_advice_2}: name: 'July' - date: !eval time.strftime( "%Y-%m-%d" ) + date: !eval "'%s-07-01' %(datetime.now().year)" chaque_nos: '007568' line_ids: - employee_id: 'hr.employee_fp' @@ -34,9 +34,9 @@ bysal: '20000' debit_credit: 'C' - - I check my payment order state is Confirmed + I check that the Payment Advice is in draft - - !assert {model: hr.payroll.advice, id: payment_advice_1, string: state is confirmed}: + !assert {model: hr.payroll.advice, id: payment_advice_1, string: Payment Advice is in draft state}: - state == 'draft' - In order to test the PDF reports defined on a Payment Advice,we will print a Payment Advice Detail Summary Report when NEFT is checked @@ -53,4 +53,4 @@ import netsvc, tools, os (data, format) = netsvc.LocalService('report.payroll.advice').create(cr, uid, [ref('l10n_in_hr_payroll.payment_advice_2')], {}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'l10n_in_hr_payroll_summary report'+format), 'wb+').write(data) + file(os.path.join(tools.config['test_report_directory'], 'l10n_in_hr_payroll_summary report'+format), 'wb+').write(data) From cbde761af6d0b3923534f83c97f4c0cc98f13759 Mon Sep 17 00:00:00 2001 From: Digvijay Singh Date: Thu, 26 Jul 2012 12:21:30 +0530 Subject: [PATCH 4/5] [IMP]l10n_in_hr_payroll: add yaml file for payment advice bzr revid: dsi@tinyerp.com-20120726065130-xdhi6vnqinwu3i98 --- .../test/payment_advice.yml | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/addons/l10n_in_hr_payroll/test/payment_advice.yml b/addons/l10n_in_hr_payroll/test/payment_advice.yml index 033b276c40d..ecbd9f47385 100644 --- a/addons/l10n_in_hr_payroll/test/payment_advice.yml +++ b/addons/l10n_in_hr_payroll/test/payment_advice.yml @@ -9,30 +9,27 @@ bank_id: 'base.res_bank_1' chaque_nos: '007667' line_ids: - - employee_id: 'hr.employee_fp' + - employee_id: hr.employee_fp name: '90125452' ifsc_code: 'abn45215145' - bysal: '25000' - debit_credit: 'C' - - employee_id: 'hr.employee_al' + bysal: '25000.00' + - employee_id: hr.employee_al name: '00014521111232' ifsc_code: 'sbi45452145' - bysal: '20000' - debit_credit: 'C' + bysal: '20000.00' - !record {model: hr.payroll.advice, id: payment_advice_2}: name: 'July' date: !eval "'%s-07-01' %(datetime.now().year)" chaque_nos: '007568' + bank_id: 'base.res_bank_1' line_ids: - - employee_id: 'hr.employee_fp' + - employee_id: hr.employee_fp name: '90125452' - bysal: '25000' - debit_credit: 'C' - - employee_id: 'hr.employee_al' + bysal: '25000.00' + - employee_id: hr.employee_al name: '00014521111232' - bysal: '20000' - debit_credit: 'C' + bysal: '20000.00' - I check that the Payment Advice is in draft - From f4ee139ba1f6fb0686ecbf2fdddd5e05464c95df Mon Sep 17 00:00:00 2001 From: Digvijay Singh Date: Thu, 26 Jul 2012 17:01:10 +0530 Subject: [PATCH 5/5] [IMP]l10n_in_hr_payroll: add yaml file for payment advice bzr revid: dsi@tinyerp.com-20120726113110-stmumo4w50usxeo5 --- .../test/payment_advice.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/addons/l10n_in_hr_payroll/test/payment_advice.yml b/addons/l10n_in_hr_payroll/test/payment_advice.yml index ecbd9f47385..c9d8cb9b287 100644 --- a/addons/l10n_in_hr_payroll/test/payment_advice.yml +++ b/addons/l10n_in_hr_payroll/test/payment_advice.yml @@ -1,12 +1,14 @@ +- + In order to test Advice Line I create a new Advice Line Record - import datetime - - I create a new Payment Advice For Month june and july + I create a new Payment Advice with IFSC Code - !record {model: hr.payroll.advice, id: payment_advice_1}: name: 'June' date: !eval "'%s-06-01' %(datetime.now().year)" - bank_id: 'base.res_bank_1' + bank_id: base.res_bank_1 chaque_nos: '007667' line_ids: - employee_id: hr.employee_fp @@ -17,12 +19,14 @@ name: '00014521111232' ifsc_code: 'sbi45452145' bysal: '20000.00' +- + I create a new Payment Advice without IFSC Code - !record {model: hr.payroll.advice, id: payment_advice_2}: name: 'July' date: !eval "'%s-07-01' %(datetime.now().year)" chaque_nos: '007568' - bank_id: 'base.res_bank_1' + bank_id: base.res_bank_1 line_ids: - employee_id: hr.employee_fp name: '90125452' @@ -35,6 +39,15 @@ - !assert {model: hr.payroll.advice, id: payment_advice_1, string: Payment Advice is in draft state}: - state == 'draft' +- + I check that payment advice is confirmed +- + !python {model: hr.payroll.advice}: | + advice_line = self.confirm_sheet(cr, uid, [ref('payment_advice_1')]) +- + !python {model: hr.payroll.advice}: | + advice_line = self.browse(cr, uid, ref("payment_advice_1")) + assert (advice_line.state == 'confirm') - In order to test the PDF reports defined on a Payment Advice,we will print a Payment Advice Detail Summary Report when NEFT is checked -