Merge lp:~openerp-dev/openobject-addons/6.1-opw-584776-han into lp:openobject-addons/6.1

Proposed by Hardik Ansodariya (OpenERP)
Status: Merged
Approved by: Xavier ALT
Approved revision: no longer in the source branch.
Merged at revision: 7169
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-584776-han
Merge into: lp:openobject-addons/6.1
Diff against target: 17 lines (+5/-2)
1 file modified
hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py (+5/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-584776-han
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+150495@code.launchpad.net

Description of the change

Hello,

Fixed the issue of periodical billing.

When we created an invoice from an account analytic line. If we use another product with a different taxes, this one isn't set in the invoice.

Steps:

Accounting > Periodical Processing > Billing > Bill Tasks Works

Create Bill Tasks works.

Now create invoice from wizard > select another product than selected in Bill task works.

Taxes of new product will be taken into consideration in created invoice.

This branch fixes the issue.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py'
2--- hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py 2011-11-16 14:59:58 +0000
3+++ hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py 2013-02-26 06:28:22 +0000
4@@ -124,8 +124,11 @@
5 price = pro_price_obj.price_get(cr,uid,[pl], data.get('product', False) or product_id, qty or 1.0, account.partner_id.id, context=ctx)[pl]
6 else:
7 price = 0.0
8-
9- taxes = product.taxes_id
10+ product_tax = product_obj.browse(cr, uid, data.get('product', product_id), context=context)
11+ if data.get('product', product_id):
12+ taxes = product_tax.taxes_id
13+ else:
14+ taxes = product.taxes_id
15 tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes)
16 account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
17 if not account_id: