[6.0.2] Wrong Warehouse/Reporting/Inventory Analysis when you have move lines with different UoM

Bug #810934 reported by Jordi Esteve (www.zikzakmedia.com)
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Addons Team 2

Bug Description

v 6.0.2. The Warehouse/Reporting/Inventory Analysis is wrong when you have move lines with different UoM of the same UoM category. I think the factor conversion in the related postgres view is not correctly computed.

If the following 4 multiplications are changed by 4 divisions the inventory analysis works Ok:

Index: report/report_stock_move.py
===================================================================
--- report/report_stock_move.py (revisión: 146)
+++ report/report_stock_move.py (copia de trabajo)
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
 ##############################################################################
 #
 # OpenERP, Open Source Management Solution
@@ -176,8 +176,8 @@
         m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,
         m.company_id,
         m.state as state, m.prodlot_id as prodlot_id,
- coalesce(sum(-m.product_qty * u.factor)::decimal, 0.0) as product_qty,
- coalesce(sum(-pt.standard_price * m.product_qty * u.factor)::decimal, 0.0) as value
+ coalesce(sum(-m.product_qty / u.factor)::decimal, 0.0) as product_qty,
+ coalesce(sum(-pt.standard_price * m.product_qty / u.factor)::decimal, 0.0) as value
     FROM
         stock_move m
             LEFT JOIN stock_picking p ON (m.picking_id=p.id)
@@ -195,8 +195,8 @@
         m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,
         m.company_id,
         m.state as state, m.prodlot_id as prodlot_id,
- coalesce(sum(m.product_qty*u.factor)::decimal, 0.0) as product_qty,
- coalesce(sum(pt.standard_price * m.product_qty * u.factor)::decimal, 0.0) as value
+ coalesce(sum(m.product_qty/u.factor)::decimal, 0.0) as product_qty,
+ coalesce(sum(pt.standard_price * m.product_qty / u.factor)::decimal, 0.0) as value
     FROM
         stock_move m
             LEFT JOIN stock_picking p ON (m.picking_id=p.id)

Related branches

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Low
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Atik Agewan(OpenERP) (aag-openerp) wrote :

Hello Jordi,

Thanks for reporting,
It has been fixed in lp:~openerp-dev/openobject-addons/trunk-bug-810934-aag
Revision ID: <email address hidden>
Revision num: 4892.
It will be available in trunk soon,

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

see r5156..5157 for correct fix.

Changed in openobject-addons:
status: Fix Committed → Fix Released
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.