merge sto-stoloc data

bzr revid: jke@openerp.com-20131010120331-hbhckxnwju1p6mg9
This commit is contained in:
jke-openerp 2013-10-10 14:03:31 +02:00
parent 27f2eb58fc
commit b4d98b487a
12 changed files with 74 additions and 23 deletions

View File

@ -58,9 +58,11 @@ Dashboard / Reports for Warehouse Management will include:
'category': 'Warehouse Management',
'sequence': 16,
'demo': [
'stock_demo_pre.yml',
'stock_demo.xml',
'procurement_demo.xml',
'stock_orderpoint.xml',
'stock_orderpoint.yml',
'stock_demo.yml',
'stock_location_demo_cpu1.xml',
'stock_location_demo_cpu3.yml',
@ -70,7 +72,7 @@ Dashboard / Reports for Warehouse Management will include:
'security/ir.model.access.csv',
'stock_data.xml',
'stock_data.yml',
# 'stock_location_data.xml',
'stock_set_ir_model_data.yml',
'wizard/stock_move_view.xml',
'wizard/stock_change_product_qty_view.xml',
'wizard/stock_inventory_merge_view.xml',

View File

@ -1943,9 +1943,8 @@ class stock_inventory(osv.osv):
def _default_stock_location(self, cr, uid, context=None):
try:
stock_location = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock')
#stock_location = self.pool.get('stock.warehouse').browse(cr, uid, ref('warehouse0'), context=context).lot_stock_id
return stock_location.id
warehouse = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'warehouse0')
return warehouse.lot_stock_id.id
except:
return False
@ -2213,8 +2212,12 @@ class stock_warehouse(osv.osv):
}
def _default_stock_id(self, cr, uid, context=None):
lot_input_stock = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock')
return lot_input_stock.id
#lot_input_stock = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock')
try:
warehouse = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'warehouse0')
return warehouse.lot_stock_id.id
except:
return False
_defaults = {
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.inventory', context=c),

View File

@ -1,6 +1,6 @@
-
!python {model: res.partner}: |
main_warehouse = self.pool.get('stock.warehouse').browse(cr, uid, ref('warehouse0'), context=context)
print(main_warehouse.name)
self.write(cr, uid, ref('base.main_partner'), {'property_stock_customer':main_warehouse.lot_stock_id.id})

View File

@ -34,6 +34,9 @@
<field name="location_id" ref="stock_location_customers"/>
<field name="usage">customer</field>
</record>
<!--
<record id="stock_location_14" model="stock.location">
<field name="name">Shelf 2</field>
<field name="location_id" ref="stock_location_stock"/>
@ -42,7 +45,7 @@
<field name="name">Shelf 1</field>
<field name="location_id" ref="stock_location_stock"/>
</record>
-->
<!-- Resource: stock.inventory -->

View File

@ -66,9 +66,13 @@
prod_lot_id: lot_icecream_1
location_id: location_refrigerator
-
!record {model: stock.picking, id: outgoing_shipment}:
location_dest_id: location_delivery_counter
picking_type_id: picking_type_out
Create STOCK_PICKING for OUT
-
!python {model: stock.picking}: |
main_warehouse = self.pool.get('stock.warehouse').browse(cr, uid, ref('warehouse0'), context=context)
my_picking_type_out = main_warehouse.out_type_id.id
create_id = self.create(cr,uid,{'location_dest_id':ref('location_delivery_counter'),'picking_type_id':my_picking_type_out});
self.pool.get('ir.model.data').create(cr,uid,{'name':'outgoing_shipment','module':'stock', 'model':'stock.picking','res_id':create_id}, context=context)
-
!record {model: stock.move, id: outgoing_shipment_icecream}:
picking_id: outgoing_shipment
@ -78,10 +82,13 @@
location_id: location_refrigerator
location_dest_id: location_delivery_counter
-
!record {model: stock.picking, id: incomming_shipment}:
partner_id: base.res_partner_address_9
location_dest_id: location_refrigerator
picking_type_id: picking_type_in
Create STOCK_PICKING for IN
-
!python {model: stock.picking}: |
main_warehouse = self.pool.get('stock.warehouse').browse(cr, uid, ref('warehouse0'), context=context)
my_picking_type = main_warehouse.in_type_id.id
create_id = self.create(cr,uid,{'location_dest_id':ref('location_refrigerator'),'picking_type_id':my_picking_type,'partner_id':ref('base.res_partner_address_9')});
self.pool.get('ir.model.data').create(cr,uid,{'name':'incomming_shipment','module':'stock', 'model':'stock.picking','res_id':create_id}, context=context)
-
!record {model: stock.move, id: incomming_shipment_icecream}:
picking_id: incomming_shipment

View File

@ -0,0 +1,18 @@
-
!record {model: stock.location, id: stock_location_14}:
name: Shelf 2
posx: 6512
-
!record {model: stock.location, id: stock_location_components}:
name: Shelf 1
posx: 6512
-
!python {model: stock.location}: |
main_warehouse = self.pool.get('stock.warehouse').browse(cr, uid, ref('warehouse0'), context=context)
main_stock = main_warehouse.lot_stock_id.id
stock_loc_to_update = self.search(cr, uid, [('posx','=','6512')], context=context)
self.write(cr,uid,stock_loc_to_update,{'location_id':main_stock,'posx':'0'}, context=context)

View File

@ -3,7 +3,7 @@
<data>
<!--Pick / Pack / Input location
-->
<!--
<!--
<record id="location_pack_zone" model="stock.location">
<field name="name">Packing zone</field>
<field name="location_id" ref="company"/>

View File

@ -5,6 +5,7 @@
</record>
<record id="stock_location_quality" model="stock.location">
<field name="name">Quality Location</field>
<field name="active">True</field>
</record>
<record id="stock_location_path_4" model="stock.location.path">

View File

@ -23,4 +23,4 @@
name: Pick List
location_from_id: stock.stock_location_output
location_dest_id: location_pack_zone
picking_type_id: stock.picking_type_internal
picking_type_id: stock.picking_type_internal

View File

@ -9,7 +9,7 @@
<field name="product_uom" ref="product.product_uom_dozen"/>
<field model="stock.warehouse" name="warehouse_id" search="[]"/>
<field name="product_id" ref="product.product_product_36"/>
<field name="location_id" ref="stock.stock_location_stock"/>
<!-- <field name="location_id" ref="stock.stock_location_stock"/> -->
</record>
<record id="stock_warehouse_orderpoint_1" model="stock.warehouse.orderpoint">
<field name="product_max_qty">10.0</field>
@ -17,7 +17,7 @@
<field name="product_uom" ref="product.product_uom_unit"/>
<field model="stock.warehouse" name="warehouse_id" search="[]"/>
<field name="product_id" ref="product.product_product_28"/>
<field name="location_id" ref="stock.stock_location_stock"/>
<!-- <field name="location_id" ref="stock.stock_location_stock"/> -->
</record>
<record id="stock_warehouse_orderpoint_2" model="stock.warehouse.orderpoint">
<field name="product_max_qty">12.0</field>
@ -25,7 +25,7 @@
<field name="product_uom" ref="product.product_uom_unit"/>
<field model="stock.warehouse" name="warehouse_id" search="[]"/>
<field name="product_id" ref="product.product_product_20"/>
<field name="location_id" ref="stock.stock_location_stock"/>
<!-- <field name="location_id" ref="stock.stock_location_stock"/> -->
</record>
<record id="stock_warehouse_orderpoint_3" model="stock.warehouse.orderpoint">
<field name="product_max_qty">50.0</field>
@ -33,7 +33,7 @@
<field name="product_uom" ref="product.product_uom_unit"/>
<field model="stock.warehouse" name="warehouse_id" search="[]"/>
<field name="product_id" ref="product.product_product_46"/>
<field name="location_id" ref="stock.stock_location_stock"/>
<!-- <field name="location_id" ref="stock.stock_location_stock"/> -->
</record>
<record id="stock_warehouse_orderpoint_4" model="stock.warehouse.orderpoint">
<field name="product_max_qty">15.0</field>
@ -41,7 +41,7 @@
<field name="product_uom" ref="product.product_uom_unit"/>
<field model="stock.warehouse" name="warehouse_id" search="[]"/>
<field name="product_id" ref="product.product_product_23"/>
<field name="location_id" ref="stock.stock_location_stock"/>
<!-- <field name="location_id" ref="stock.stock_location_stock"/> -->
</record>
<record id="stock_warehouse_orderpoint_5" model="stock.warehouse.orderpoint">
<field name="product_max_qty">5.0</field>
@ -49,7 +49,7 @@
<field name="product_uom" ref="product.product_uom_unit"/>
<field model="stock.warehouse" name="warehouse_id" search="[]"/>
<field name="product_id" ref="product.product_product_48"/>
<field name="location_id" ref="stock.stock_location_stock"/>
<!-- <field name="location_id" ref="stock.stock_location_stock"/> -->
</record>
</data>
</openerp>

View File

@ -0,0 +1,6 @@
-
!python {model: stock.location}: |
main_warehouse = self.pool.get('stock.warehouse').browse(cr, uid, ref('warehouse0'), context=context)
main_stock = main_warehouse.lot_stock_id.id
stowar_op_ids = self.pool.get('stock.warehouse.orderpoint').search(cr, uid, [], context=context)
self.pool.get('stock.warehouse.orderpoint').write(cr,uid,stowar_op_ids,{'location_id':main_stock}, context=context)

View File

@ -0,0 +1,11 @@
-
!python {model: ir.model.data, noupdate: True}: |
main_warehouse = self.pool.get('stock.warehouse').browse(cr, uid, ref('warehouse0'), context=context)
self.create(cr,uid,{'name':'stock_location_stock','module':'stock', 'model':'stock.location','res_id':main_warehouse.lot_stock_id.id}, context=context)
self.create(cr,uid,{'name':'stock_location_company','module':'stock', 'model':'stock.location','res_id':main_warehouse.wh_input_stock_loc_id.id}, context=context)
self.create(cr,uid,{'name':'stock_location_output','module':'stock', 'model':'stock.location','res_id':main_warehouse.wh_output_stock_loc_id.id}, context=context)
self.create(cr,uid,{'name':'location_pack_zone','module':'stock', 'model':'stock.location','res_id':main_warehouse.wh_pack_stock_loc_id.id}, context=context)
self.create(cr,uid,{'name':'picking_type_internal','module':'stock', 'model':'stock.picking.type','res_id':main_warehouse.int_type_id.id}, context=context)
self.create(cr,uid,{'name':'picking_type_in','module':'stock', 'model':'stock.picking.type','res_id':main_warehouse.in_type_id.id}, context=context)
self.create(cr,uid,{'name':'picking_type_out','module':'stock', 'model':'stock.picking.type','res_id':main_warehouse.out_type_id.id}, context=context)