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
1=== modified file 'stock/report/report_stock_move.py'
2--- stock/report/report_stock_move.py 2011-12-19 16:54:40 +0000
3+++ stock/report/report_stock_move.py 2012-04-19 13:30:50 +0000
4@@ -166,6 +166,7 @@
5 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\'.\
6 \nThe state is \'Waiting\' if the move is waiting for another one.'),
7 '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),
8+ 'scrap_location': fields.boolean('scrap'),
9 }
10 def init(self, cr):
11 tools.drop_view_if_exists(cr, 'report_stock_inventory')
12@@ -174,7 +175,7 @@
13 (SELECT
14 min(m.id) as id, m.date as date,
15 m.address_id as partner_id, m.location_id as location_id,
16- m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,
17+ m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, l.scrap_location as scrap_location,
18 m.company_id,
19 m.state as state, m.prodlot_id as prodlot_id,
20
21@@ -191,12 +192,12 @@
22 LEFT JOIN stock_location l ON (m.location_id=l.id)
23 GROUP BY
24 m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id,
25- m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id
26+ m.prodlot_id, m.date, m.state, l.usage, l.scrap_location, m.company_id, pt.uom_id
27 ) UNION ALL (
28 SELECT
29 -m.id as id, m.date as date,
30 m.address_id as partner_id, m.location_dest_id as location_id,
31- m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,
32+ m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, l.scrap_location as scrap_location,
33 m.company_id,
34 m.state as state, m.prodlot_id as prodlot_id,
35 coalesce(sum(pt.standard_price * m.product_qty * pu.factor / pu2.factor)::decimal, 0.0) as value,
36@@ -212,7 +213,7 @@
37 LEFT JOIN stock_location l ON (m.location_dest_id=l.id)
38 GROUP BY
39 m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id,
40- m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id
41+ m.prodlot_id, m.date, m.state, l.usage, l.scrap_location, m.company_id, pt.uom_id
42 )
43 );
44 """)
45
46=== modified file 'stock/report/report_stock_move_view.xml'
47--- stock/report/report_stock_move_view.xml 2012-01-31 13:36:57 +0000
48+++ stock/report/report_stock_move_view.xml 2012-04-19 13:30:50 +0000
49@@ -230,7 +230,7 @@
50 <field name="state"/>
51 <field name="location_type"/>
52 <field name="date"/>
53- <filter icon="terp-go-home" name="location_type_scrap" string="Scrap" domain="[('location_type','=','scrap')]"/>
54+ <filter icon="terp-go-home" name="location_type_scrap" string="Scrap" domain="[('scrap_location','=','True')]"/>
55 </group>
56 <newline/>
57 <group expand="1" string="Group By..." >