Community mailing list archives

community@mail.odoo.com

Re: Bug ? in Payment advise creation in Indian Payroll

by
Eric Caudal
- 01/30/2016 01:46:38

Thanks for sharing. Can you fill in a bug report in github?


On Sat, Jan 30, 2016, 13:26 Cybrosys Technologies <techsupport@cybrosys.com> wrote:

Hello Community,

We installed l10n_in_hr_payroll module on odoo8. we created a payslip batch and we tried to create payment advice according to the batch. But we get this error :

Integrity Error

The operation cannot be completed, probably due to the following:

- deletion: you may be trying to delete a record while other records still reference it

- creation/update: a mandatory field is not correctly set

[object with reference: Bank - res.bank]

We dug in to code and found that
 in 'l10n_in_hr_payroll.py' file there is a method 'create_advice'(line#175)
in that, for the creation of advice it assigns field 'bank_id' as
 'bank_id': users[0].company_id.bank_ids and users[0].company_id.bank_ids[0].id or False

Actually this is a wrong assignment because, here bank_id is a many2one field of res.bank but the above code tries to assign an id of res.partner.bank.
but res.partner.bank have many2one field of res.bank, so we can use this field instead like

 'bank_id': users[0].company_id.bank_ids and users[0].company_id.bank_ids[0].bank.id or False

Hope this will work !!

is there any other solution for this issue ?

--
 
Cybrosys 
www.cybrosys.com
TECHNICAL SUPPORT
Cybrosys Odoo Department
 
 techsupport@cybrosys.com
 +91 494 3015006 / 07
 +91 8606827707
 cybrosystech
 
 
Facebook Twitter LinkedIn Google Plus Pinterest Company
 
This email and any file transmitted with it are confidential and intended solely for the use of the individual or entity whom they are addressed.If you have received this email in errort please notify the system manager. The company accepts no liability for any damage caused by any virus transmitted by this email.

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

--

Eric  Caudal (from my mobile)