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
=== modified file 'stock/stock.py'
--- stock/stock.py 2011-07-26 16:00:58 +0000
+++ stock/stock.py 2011-08-17 13:16:27 +0000
@@ -676,6 +676,15 @@
676 'domain': '[]',676 'domain': '[]',
677 'context': dict(context, active_ids=ids)677 'context': dict(context, active_ids=ids)
678 }678 }
679
680 def _keep_prodlot_hook(self, cr, uid, id, context, *args, **kwargs):
681 '''
682 hook to keep the production lot when a stock move is copied
683 '''
684 res = kwargs.get('res')
685 assert res is not None, 'missing res'
686
687 return res
679688
680 def copy(self, cr, uid, id, default=None, context=None):689 def copy(self, cr, uid, id, default=None, context=None):
681 if default is None:690 if default is None:
@@ -688,8 +697,9 @@
688 default['name'] = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name)697 default['name'] = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name)
689 default['origin'] = ''698 default['origin'] = ''
690 default['backorder_id'] = False699 default['backorder_id'] = False
700
691 res = super(stock_picking, self).copy(cr, uid, id, default, context)701 res = super(stock_picking, self).copy(cr, uid, id, default, context)
692 if res:702 if self._keep_prodlot_hook(cr, uid, id, context, res=res):
693 picking_obj = self.browse(cr, uid, res, context=context)703 picking_obj = self.browse(cr, uid, res, context=context)
694 for move in picking_obj.move_lines:704 for move in picking_obj.move_lines:
695 move_obj.write(cr, uid, [move.id], {'tracking_id': False,'prodlot_id':False})705 move_obj.write(cr, uid, [move.id], {'tracking_id': False,'prodlot_id':False})
696706
=== modified file 'stock/stock_data.xml'
--- stock/stock_data.xml 2011-01-14 00:11:01 +0000
+++ stock/stock_data.xml 2011-08-17 13:16:27 +0000
@@ -102,6 +102,18 @@
102 <field name="name">Stock</field>102 <field name="name">Stock</field>
103 <field name="location_id" ref="stock_location_company"/>103 <field name="location_id" ref="stock_location_company"/>
104 </record>104 </record>
105 <record id="stock_location_packing" model="stock.location">
106 <field name="name">Packing</field>
107 <field name="location_id" ref="stock_location_company"/>
108 </record>
109 <record id="stock_location_dispatch" model="stock.location">
110 <field name="name">Dispatch</field>
111 <field name="location_id" ref="stock_location_company"/>
112 </record>
113 <record id="stock_location_distribution" model="stock.location">
114 <field name="name">Distribution</field>
115 <field name="location_id" ref="stock_location_company"/>
116 </record>
105117
106 <!--118 <!--
107 Properties119 Properties
@@ -151,6 +163,9 @@
151 <field name="lot_input_id" ref="stock_location_stock"/>163 <field name="lot_input_id" ref="stock_location_stock"/>
152 <field name="lot_stock_id" ref="stock_location_stock"/>164 <field name="lot_stock_id" ref="stock_location_stock"/>
153 <field name="lot_output_id" ref="stock_location_output"/>165 <field name="lot_output_id" ref="stock_location_output"/>
166 <field name="lot_packing_id" ref="stock_location_packing"/>
167 <field name="lot_dispatch_id" ref="stock_location_dispatch"/>
168 <field name="lot_distribution_id" ref="stock_location_distribution"/>
154 </record>169 </record>
155 </data>170 </data>
156</openerp>171</openerp>
157172
=== modified file 'stock/stock_demo.xml'
--- stock/stock_demo.xml 2011-01-14 00:11:01 +0000
+++ stock/stock_demo.xml 2011-08-17 13:16:27 +0000
@@ -248,6 +248,9 @@
248 <field name="partner_address_id" ref="res_partner_address_fabien0"/>248 <field name="partner_address_id" ref="res_partner_address_fabien0"/>
249 <field name="company_id" ref="res_company_shop0"/>249 <field name="company_id" ref="res_company_shop0"/>
250 <field name="lot_input_id" ref="stock_location_shop0"/>250 <field name="lot_input_id" ref="stock_location_shop0"/>
251 <field name="lot_packing_id" ref="stock_location_packing"/>
252 <field name="lot_dispatch_id" ref="stock_location_dispatch"/>
253 <field name="lot_distribution_id" ref="stock_location_distribution"/>
251 </record>254 </record>
252 <record id="stock_warehouse_shop1" model="stock.warehouse">255 <record id="stock_warehouse_shop1" model="stock.warehouse">
253 <field name="lot_output_id" ref="stock.stock_location_output"/>256 <field name="lot_output_id" ref="stock.stock_location_output"/>
@@ -256,6 +259,9 @@
256 <field name="partner_address_id" ref="res_partner_address_eric0"/>259 <field name="partner_address_id" ref="res_partner_address_eric0"/>
257 <field name="company_id" ref="res_company_tinyshop0"/>260 <field name="company_id" ref="res_company_tinyshop0"/>
258 <field name="lot_input_id" ref="stock_location_shop1"/>261 <field name="lot_input_id" ref="stock_location_shop1"/>
262 <field name="lot_packing_id" ref="stock_location_packing"/>
263 <field name="lot_dispatch_id" ref="stock_location_dispatch"/>
264 <field name="lot_distribution_id" ref="stock_location_distribution"/>
259 </record>265 </record>
260266
261 <record forcecreate="True" id="property_stock_variation" model="ir.property">267 <record forcecreate="True" id="property_stock_variation" model="ir.property">

Subscribers

People subscribed via source and target branches

to all changes: