Amit Bhavsar (Open ERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-985635-ahu into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
  Amit Parik (OpenERP) (amp-openerp)
Related bugs:
  Bug #985635 in OpenERP Addons: "[6.1]/[trunk]Scrap filter in inventory 
analysis doesn't work"
  https://bugs.launchpad.net/openobject-addons/+bug/985635

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-985635-ahu/+merge/104093

Hello,

Fixes the searching problem in inventory analysis.

Thanks
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-985635-ahu/+merge/104093
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-985635-ahu.
=== modified file 'stock/report/report_stock_move.py'
--- stock/report/report_stock_move.py	2012-08-21 07:40:51 +0000
+++ stock/report/report_stock_move.py	2012-08-28 09:02:20 +0000
@@ -167,6 +167,7 @@
               help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Avaiable\'.\n When the picking it done the state is \'Done\'.\
               \nThe state is \'Waiting\' if the move is waiting for another one.'),
         'location_type': fields.selection([('supplier', 'Supplier Location'), ('view', 'View'), ('internal', 'Internal Location'), ('customer', 'Customer Location'), ('inventory', 'Inventory'), ('procurement', 'Procurement'), ('production', 'Production'), ('transit', 'Transit Location for Inter-Companies Transfers')], 'Location Type', required=True),
+        'scrap_location': fields.boolean('scrap'),
     }
     def init(self, cr):
         tools.drop_view_if_exists(cr, 'report_stock_inventory')
@@ -177,7 +178,7 @@
         to_char(m.date, 'YYYY') as year,
         to_char(m.date, 'MM') as month,
         m.partner_id as partner_id, m.location_id as location_id,
-        m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,
+        m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, l.scrap_location as scrap_location,
         m.company_id,
         m.state as state, m.prodlot_id as prodlot_id,
 
@@ -194,14 +195,14 @@
             LEFT JOIN stock_location l ON (m.location_id=l.id)
     GROUP BY
         m.id, m.product_id, m.product_uom, pt.categ_id, m.partner_id, m.location_id,  m.location_dest_id,
-        m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id, to_char(m.date, 'YYYY'), to_char(m.date, 'MM')
+        m.prodlot_id, m.date, m.state, l.usage, l.scrap_location, m.company_id, pt.uom_id, to_char(m.date, 'YYYY'), to_char(m.date, 'MM')
 ) UNION ALL (
     SELECT
         -m.id as id, m.date as date,
         to_char(m.date, 'YYYY') as year,
         to_char(m.date, 'MM') as month,
         m.partner_id as partner_id, m.location_dest_id as location_id,
-        m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,
+        m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, l.scrap_location as scrap_location,
         m.company_id,
         m.state as state, m.prodlot_id as prodlot_id,
         coalesce(sum(pt.standard_price * m.product_qty * pu.factor / pu2.factor)::decimal, 0.0) as value,
@@ -217,7 +218,7 @@
             LEFT JOIN stock_location l ON (m.location_dest_id=l.id)
     GROUP BY
         m.id, m.product_id, m.product_uom, pt.categ_id, m.partner_id, m.location_id, m.location_dest_id,
-        m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id, to_char(m.date, 'YYYY'), to_char(m.date, 'MM')
+        m.prodlot_id, m.date, m.state, l.usage, l.scrap_location, m.company_id, pt.uom_id, to_char(m.date, 'YYYY'), to_char(m.date, 'MM')
     )
 );
         """)

=== modified file 'stock/report/report_stock_move_view.xml'
--- stock/report/report_stock_move_view.xml	2012-08-21 08:47:22 +0000
+++ stock/report/report_stock_move_view.xml	2012-08-28 09:02:20 +0000
@@ -154,7 +154,7 @@
                     <field name="state"/>
                     <field name="location_type"/>
                     <field name="date"/>
-                    <filter icon="terp-go-home" name="location_type_scrap" string="Scrap" domain="[('location_type','=','scrap')]"/>
+                    <filter icon="terp-go-home" name="location_type_scrap" string="Scrap" domain="[('scrap_location','=','True')]"/>
                 </group>
                 <group expand="1" string="Group By..." >
                     <filter string="Partner" name="group_partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to