account - invoices analysis - wrong net and total computation

Bug #748178 reported by Ferdinand on 2011-04-02
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Addons Team 3
credativ-openerp
Undecided
Unassigned
Addons-6.0
Undecided
Unassigned

Bug Description

please see patch and comments inside
patch also includes performance gain and simplifications
one FIXME left !

Related branches

Ferdinand (office-chricar) wrote :
Ferdinand (office-chricar) wrote :

added invoice_line.account_id to analysis to allow also analyse of invoice lines without products (especially expenses)

DBR (OpenERP) (dbr-openerp) wrote :

Thanks For reporting.

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Low
status: New → Confirmed
Ferdinand (office-chricar) wrote :

just want to add
in v5 we have some invoice lines with uos_id is null causing the avg price to be wrong
still have to investigate why this happens.

Ferdinand (office-chricar) wrote :

avg price is calculated wrong on group level
(see also https://bugs.launchpad.net/bugs/694248)

this is really embarassing - please if the model can not calculated avg at group level - do not dipslay it.
nvertheless on line detail level it is correct and schould remain there as it is very usefull.

Changed in openobject-addons:
status: Confirmed → In Progress
Priyesh (OpenERP) (pso-openerp) wrote :

Hello Ferdinand,

I have applied your patch in https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-748178-pso.
Rev-Id: <email address hidden>
Rev-no: 4640

I have removed average price from invoice analysis due to its wrong calculation on group level.

Now, only problem is remaining regarding computation of total including tax. That, we will solve as soon as possible.

Thanks for your valuable contribution.

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
milestone: none → 6.1
Ferdinand (office-chricar) wrote :

Thanks!
Obviously
"I have removed average price from invoice analysis due to its wrong calculation on group level."
leads to a loss of important functionality. (see comment 5)

Without having checked the code this problem might also occure in SO/PO/PICK .....

computing correct averages is essential for analysis
so please escalate to R&D to find a solution to compute correct averages.
I know this might be not that easy

qdp (OpenERP) (qdp) wrote :

sorry but i don't understand why the line total incl tax can't be caculated by dividing the invoice total / number of lines (as written in the patch). Can you give an example?

and for the price_average, if i do remember well: the problem is that openerp is doing a nonponderated average on the group level instead of an average that also depends on the quantity written on each line... Can't say if we will find a solution but it's currently not planned in our roadmap to work on that :-s

Anyway, thanks for the valuable contribution Ferdinand,
Quentin

qdp (OpenERP) (qdp) wrote :

i merged this branch into the trunk. Please create a new bug report to explain the remaining FIXME (total incl tax); it will be easier for everyone.

Thanks,
Quentin

Changed in openobject-addons:
status: Fix Committed → Fix Released
Ferdinand (office-chricar) wrote :

sorry but i don't understand why the line total incl tax can't be caculated by dividing the invoice total / number of lines (as written in the patch). Can you give an example?

Line 1 subtotal = 100, tax =20
Line 2 subtotal = 200, tax =40

invoice total incl tax= 360
calculated total per line = 360/2 = 180 for each line , which obviously is wrong
total line 1 = 100+20=120
total line 2 = 200+40=240

qdp (OpenERP) (qdp) wrote :

yes sorry, i realized that was a stupid question too late.

qdp (OpenERP) (qdp) wrote :

btw, i do not see how we could compute the amount tax included per invoice line as this information isn't (yet?) stored at this level... currently it's only available at the invoice level (and recomputing this amount on the fly in a psql view is excluded).

i begin to think we should also simply remove that column. Is it really usefull?

Ferdinand (office-chricar) wrote :

Hmm, that's why I didn't include it in my patch.

my thoughts
* it's not a very important column (I didn't try with module tax included)

* normaly invoice_line_tax_id would allow to compute tax by line (see move_line_get tax_amount)
 it just needs t be stored.
 this may return us back to the discussion about horizontal or vertical tax calculation and rounding and the need to fix this
see
http://bazaar.launchpad.net/~c2c/+junk/c2c_austria_dev/files/head:/c2c_account_tax_rounding/

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments