Merge lp:~unifield-team/unifield-addons/modification-of-stock-for-shipment into lp:unifield-addons

Proposed by Patrick Amstutz
Status: Merged
Merged at revision: 4484
Proposed branch: lp:~unifield-team/unifield-addons/modification-of-stock-for-shipment
Merge into: lp:unifield-addons
Diff against target: 87 lines (+32/-1)
3 files modified
stock/stock.py (+11/-1)
stock/stock_data.xml (+15/-0)
stock/stock_demo.xml (+6/-0)
To merge this branch: bzr merge lp:~unifield-team/unifield-addons/modification-of-stock-for-shipment
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+71515@code.launchpad.net

Description of the change

modification for shipment wm

To post a comment you must log in.
4483. By jf <jf@tempo4>

[FIX] OEB-28: purchase_double_validation and unit test

4484. By jf <jf@tempo4>

Hook UF-368: Specific Stock Locations

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/stock.py'
2--- stock/stock.py 2011-07-26 16:00:58 +0000
3+++ stock/stock.py 2011-08-17 13:16:27 +0000
4@@ -676,6 +676,15 @@
5 'domain': '[]',
6 'context': dict(context, active_ids=ids)
7 }
8+
9+ def _keep_prodlot_hook(self, cr, uid, id, context, *args, **kwargs):
10+ '''
11+ hook to keep the production lot when a stock move is copied
12+ '''
13+ res = kwargs.get('res')
14+ assert res is not None, 'missing res'
15+
16+ return res
17
18 def copy(self, cr, uid, id, default=None, context=None):
19 if default is None:
20@@ -688,8 +697,9 @@
21 default['name'] = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name)
22 default['origin'] = ''
23 default['backorder_id'] = False
24+
25 res = super(stock_picking, self).copy(cr, uid, id, default, context)
26- if res:
27+ if self._keep_prodlot_hook(cr, uid, id, context, res=res):
28 picking_obj = self.browse(cr, uid, res, context=context)
29 for move in picking_obj.move_lines:
30 move_obj.write(cr, uid, [move.id], {'tracking_id': False,'prodlot_id':False})
31
32=== modified file 'stock/stock_data.xml'
33--- stock/stock_data.xml 2011-01-14 00:11:01 +0000
34+++ stock/stock_data.xml 2011-08-17 13:16:27 +0000
35@@ -102,6 +102,18 @@
36 <field name="name">Stock</field>
37 <field name="location_id" ref="stock_location_company"/>
38 </record>
39+ <record id="stock_location_packing" model="stock.location">
40+ <field name="name">Packing</field>
41+ <field name="location_id" ref="stock_location_company"/>
42+ </record>
43+ <record id="stock_location_dispatch" model="stock.location">
44+ <field name="name">Dispatch</field>
45+ <field name="location_id" ref="stock_location_company"/>
46+ </record>
47+ <record id="stock_location_distribution" model="stock.location">
48+ <field name="name">Distribution</field>
49+ <field name="location_id" ref="stock_location_company"/>
50+ </record>
51
52 <!--
53 Properties
54@@ -151,6 +163,9 @@
55 <field name="lot_input_id" ref="stock_location_stock"/>
56 <field name="lot_stock_id" ref="stock_location_stock"/>
57 <field name="lot_output_id" ref="stock_location_output"/>
58+ <field name="lot_packing_id" ref="stock_location_packing"/>
59+ <field name="lot_dispatch_id" ref="stock_location_dispatch"/>
60+ <field name="lot_distribution_id" ref="stock_location_distribution"/>
61 </record>
62 </data>
63 </openerp>
64
65=== modified file 'stock/stock_demo.xml'
66--- stock/stock_demo.xml 2011-01-14 00:11:01 +0000
67+++ stock/stock_demo.xml 2011-08-17 13:16:27 +0000
68@@ -248,6 +248,9 @@
69 <field name="partner_address_id" ref="res_partner_address_fabien0"/>
70 <field name="company_id" ref="res_company_shop0"/>
71 <field name="lot_input_id" ref="stock_location_shop0"/>
72+ <field name="lot_packing_id" ref="stock_location_packing"/>
73+ <field name="lot_dispatch_id" ref="stock_location_dispatch"/>
74+ <field name="lot_distribution_id" ref="stock_location_distribution"/>
75 </record>
76 <record id="stock_warehouse_shop1" model="stock.warehouse">
77 <field name="lot_output_id" ref="stock.stock_location_output"/>
78@@ -256,6 +259,9 @@
79 <field name="partner_address_id" ref="res_partner_address_eric0"/>
80 <field name="company_id" ref="res_company_tinyshop0"/>
81 <field name="lot_input_id" ref="stock_location_shop1"/>
82+ <field name="lot_packing_id" ref="stock_location_packing"/>
83+ <field name="lot_dispatch_id" ref="stock_location_dispatch"/>
84+ <field name="lot_distribution_id" ref="stock_location_distribution"/>
85 </record>
86
87 <record forcecreate="True" id="property_stock_variation" model="ir.property">

Subscribers

People subscribed via source and target branches

to all changes: