openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #15849
[Bug 1052785] [NEW] expense to invoice does not fill bank account
Public bug reported:
When transforming an expense to invoice, employee bank account is not taken back into generated supplier invoice.
This patch should do the trick:
=== modified file 'hr_expense/hr_expense.py'
--- hr_expense/hr_expense.py 2012-09-17 08:57:39 +0000
+++ hr_expense/hr_expense.py 2012-09-17 09:41:45 +0000
@@ -187,6 +187,7 @@
raise osv.except_osv(_('Error !'), _("The employee's home address must have a partner linked."))
acc = exp.employee_id.address_home_id.partner_id.property_account_payable.id
payment_term_id = exp.employee_id.address_home_id.partner_id.property_payment_term.id
+ part = exp.employee_id.address_home_id.partner_id
inv = {
'name': exp.name,
'reference': sequence_obj.get(cr, uid, 'hr.expense.invoice'),
@@ -201,6 +202,7 @@
'currency_id': exp.currency_id.id,
'payment_term': payment_term_id,
'fiscal_position': exp.employee_id.address_home_id.partner_id.property_account_position.id,
+ 'partner_bank_id': part.bank_ids and part.bank_ids[0].id or False,
'reference_type': 'none'
}
if payment_term_id:
Regards
Nicolas
** Affects: openobject-addons
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1052785
Title:
expense to invoice does not fill bank account
Status in OpenERP Addons (modules):
New
Bug description:
When transforming an expense to invoice, employee bank account is not taken back into generated supplier invoice.
This patch should do the trick:
=== modified file 'hr_expense/hr_expense.py'
--- hr_expense/hr_expense.py 2012-09-17 08:57:39 +0000
+++ hr_expense/hr_expense.py 2012-09-17 09:41:45 +0000
@@ -187,6 +187,7 @@
raise osv.except_osv(_('Error !'), _("The employee's home address must have a partner linked."))
acc = exp.employee_id.address_home_id.partner_id.property_account_payable.id
payment_term_id = exp.employee_id.address_home_id.partner_id.property_payment_term.id
+ part = exp.employee_id.address_home_id.partner_id
inv = {
'name': exp.name,
'reference': sequence_obj.get(cr, uid, 'hr.expense.invoice'),
@@ -201,6 +202,7 @@
'currency_id': exp.currency_id.id,
'payment_term': payment_term_id,
'fiscal_position': exp.employee_id.address_home_id.partner_id.property_account_position.id,
+ 'partner_bank_id': part.bank_ids and part.bank_ids[0].id or False,
'reference_type': 'none'
}
if payment_term_id:
Regards
Nicolas
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1052785/+subscriptions
Follow ups
References