Merge lp:~openerp-dev/openobject-addons/6.1-scrap-inventory-analysis-fix-ahu into lp:openobject-addons/6.1

Proposed by Antoine(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-scrap-inventory-analysis-fix-ahu
Merge into: lp:openobject-addons/6.1
Diff against target: 57 lines (+6/-5)
2 files modified
stock/report/report_stock_move.py (+5/-4)
stock/report/report_stock_move_view.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-scrap-inventory-analysis-fix-ahu
Reviewer Review Type Date Requested Status
Xavier ALT Pending
Review via email: mp+102700@code.launchpad.net

Description of the change

Allows the scrap location button to work properly in "Warehouse > Reporting > Inventory Analysis". See linked bug for more details.

To post a comment you must log in.

Unmerged revisions

6746. By Antoine Huvelle <email address hidden>

[IMP] Scrap button in the inventory analysis in the stock management works now properly

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'stock/report/report_stock_move.py'
--- stock/report/report_stock_move.py 2011-12-19 16:54:40 +0000
+++ stock/report/report_stock_move.py 2012-04-19 13:30:50 +0000
@@ -166,6 +166,7 @@
166 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\'.\166 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\'.\
167 \nThe state is \'Waiting\' if the move is waiting for another one.'),167 \nThe state is \'Waiting\' if the move is waiting for another one.'),
168 '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),168 '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),
169 'scrap_location': fields.boolean('scrap'),
169 }170 }
170 def init(self, cr):171 def init(self, cr):
171 tools.drop_view_if_exists(cr, 'report_stock_inventory')172 tools.drop_view_if_exists(cr, 'report_stock_inventory')
@@ -174,7 +175,7 @@
174 (SELECT175 (SELECT
175 min(m.id) as id, m.date as date,176 min(m.id) as id, m.date as date,
176 m.address_id as partner_id, m.location_id as location_id,177 m.address_id as partner_id, m.location_id as location_id,
177 m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,178 m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, l.scrap_location as scrap_location,
178 m.company_id,179 m.company_id,
179 m.state as state, m.prodlot_id as prodlot_id,180 m.state as state, m.prodlot_id as prodlot_id,
180181
@@ -191,12 +192,12 @@
191 LEFT JOIN stock_location l ON (m.location_id=l.id)192 LEFT JOIN stock_location l ON (m.location_id=l.id)
192 GROUP BY193 GROUP BY
193 m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id,194 m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id,
194 m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id195 m.prodlot_id, m.date, m.state, l.usage, l.scrap_location, m.company_id, pt.uom_id
195) UNION ALL (196) UNION ALL (
196 SELECT197 SELECT
197 -m.id as id, m.date as date,198 -m.id as id, m.date as date,
198 m.address_id as partner_id, m.location_dest_id as location_id,199 m.address_id as partner_id, m.location_dest_id as location_id,
199 m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,200 m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, l.scrap_location as scrap_location,
200 m.company_id,201 m.company_id,
201 m.state as state, m.prodlot_id as prodlot_id,202 m.state as state, m.prodlot_id as prodlot_id,
202 coalesce(sum(pt.standard_price * m.product_qty * pu.factor / pu2.factor)::decimal, 0.0) as value,203 coalesce(sum(pt.standard_price * m.product_qty * pu.factor / pu2.factor)::decimal, 0.0) as value,
@@ -212,7 +213,7 @@
212 LEFT JOIN stock_location l ON (m.location_dest_id=l.id)213 LEFT JOIN stock_location l ON (m.location_dest_id=l.id)
213 GROUP BY214 GROUP BY
214 m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id,215 m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id,
215 m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id216 m.prodlot_id, m.date, m.state, l.usage, l.scrap_location, m.company_id, pt.uom_id
216 )217 )
217);218);
218 """)219 """)
219220
=== modified file 'stock/report/report_stock_move_view.xml'
--- stock/report/report_stock_move_view.xml 2012-01-31 13:36:57 +0000
+++ stock/report/report_stock_move_view.xml 2012-04-19 13:30:50 +0000
@@ -230,7 +230,7 @@
230 <field name="state"/>230 <field name="state"/>
231 <field name="location_type"/>231 <field name="location_type"/>
232 <field name="date"/>232 <field name="date"/>
233 <filter icon="terp-go-home" name="location_type_scrap" string="Scrap" domain="[('location_type','=','scrap')]"/>233 <filter icon="terp-go-home" name="location_type_scrap" string="Scrap" domain="[('scrap_location','=','True')]"/>
234 </group>234 </group>
235 <newline/>235 <newline/>
236 <group expand="1" string="Group By..." >236 <group expand="1" string="Group By..." >