Merge lp:~openerp-dev/openobject-addons/trunk-bug-1024193-jir into lp:openobject-addons

Proposed by Jignesh Rathod(OpenERP)
Status: Work in progress
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1024193-jir
Merge into: lp:openobject-addons
Diff against target: 14 lines (+3/-1)
1 file modified
account/account_invoice.py (+3/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1024193-jir
Reviewer Review Type Date Requested Status
Amit Parik (community) Disapprove
Mustufa Rangwala (Open ERP) (community) Needs Fixing
Review via email: mp+115322@code.launchpad.net

Description of the change

Hello ,

when you create invoice with product that have two tax then it
will create a wrong entry credit and debit with 0 and
tax base amount greater then 0.

Thank you!

To post a comment you must log in.
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Hello Jignesh,

As bug come from account_analytic_plan module and your fix land on account module.
I think problem can be fix from account_analytic_plan module itself with move_line_get or _get_analytic_lines method.

Thanks for your effort,
Mustufa

review: Needs Fixing
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello,

Problem doesn't comes from the account_analytic_plan jignesh was correct problem comes from the account_move_line.
But Actually this is not a bug rather then it behavior, you can see the good commnent by mat on lp:1154270 see

*Concerning the bug itself, it is wrong. The zero lines are needed to add the information about taxes. When you have more than one tax, the zero line is generated. This is to keep the information of every tax code used. We can not simply merge all the tax in only one account move line, we would lose information and tax reports would be wrong (legal problem).*

This is the reason given by mat on lp:1154270

Thank you!

review: Disapprove

Unmerged revisions

7061. By jir <jir@jir-desktop>

[FIX] fixes problem of wrong move line create from invoice with debit and credit 0 amount and tax base amount > 0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_invoice.py'
2--- account/account_invoice.py 2012-07-14 23:18:43 +0000
3+++ account/account_invoice.py 2012-07-17 11:47:34 +0000
4@@ -951,7 +951,9 @@
5 _('You cannot create an invoice on a centralised journal. Uncheck the centralised counterpart box in the related journal from the configuration menu.'))
6
7 line = self.finalize_invoice_move_lines(cr, uid, inv, line)
8-
9+ for rem_line in line:
10+ if rem_line[2]['credit'] + rem_line[2]['debit'] == 0 and rem_line[2]['tax_amount'] > 0:
11+ line.remove(rem_line)
12 move = {
13 'ref': inv.reference and inv.reference or inv.name,
14 'line_id': line,

Subscribers

People subscribed via source and target branches

to all changes: