[IMP]stock: update product id

bzr revid: dbr@tinyerp.com-20111208104030-xte7iw35irho7tn4
This commit is contained in:
DBR (OpenERP)
2011-12-08 16:10:30 +05:30
parent 41a1eea482
commit aaafb43c2b
4 changed files with 8 additions and 18 deletions
+1 -1
View File
@@ -321,7 +321,7 @@
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/>
</record>
<record id="product_product_sprouting" model="product.product">
<record id="product_product_ice" model="product.product">
<field name="default_code">Ice</field>
<field name="supply_method">buy</field>
<field name="list_price">100.0</field>
-1
View File
@@ -86,7 +86,6 @@ Thanks to the double entry management, the inventory controlling is powerful and
'test/stock_update.yml',
'test/stock_chain_location.yml',
'test/stock_demo_backorder.yml',
#'test/stock_new_pack.yml',
'test/stock_report.yml',
'test/delete_stock.yml',
'test/cancel_stock.yml',
+1 -10
View File
@@ -23,13 +23,4 @@
location_id: stock.stock_location_stock
name: CPU3, Processor AMD Athlon XP 1800
picking_id: stock_picking_1
-
!record {model: stock.move, id: stock_move_3}:
product_id: product.product_product_pc1
product_uom: product.product_uom_unit
product_uos_qty: 5.0
product_qty: 5.0
location_dest_id: stock.stock_location_customers
location_id: stock.stock_location_stock
name: PC1, Basic PC
picking_id: stock_picking_1
+6 -6
View File
@@ -4,7 +4,7 @@
I create stock production lot for product.
-
!record {model: stock.production.lot, id: stock_production_lot2}:
product_id: product.product_product_sprouting
product_id: product.product_product_ice
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
name: 00000002
-
@@ -12,14 +12,14 @@
-
!python {model: product.product}: |
change_qty = self.pool.get('stock.change.product.qty')
product = self.browse(cr, uid, ref('product.product_product_sprouting'))
product = self.browse(cr, uid, ref('product.product_product_ice'))
ids = change_qty.create(cr, uid, {'location_id' : ref('convenience_location_stock'), 'new_quantity': 5, 'product_id': product.id,'prodlot_id': ref('stock_production_lot2')})
change_qty.change_product_qty(cr, uid, [ids], {'active_model':'product.product', 'active_id': product.id, 'active_ids':[product.id]})
-
I check stock moves of product.
-
!python {model: stock.move}: |
ids = self.search(cr, uid, [('product_id','=',ref('product.product_product_sprouting'))])
ids = self.search(cr, uid, [('product_id','=',ref('product.product_product_ice'))])
for move in self.browse(cr, uid, ids):
assert move.product_qty >= 1,"Product is not correspond"
if move.location_id.name == 'Inventory loss':
@@ -32,7 +32,7 @@
I create a move and scrap some quantities from it.
-
!python {model: stock.move.scrap}: |
ids = self.pool.get('stock.move').search(cr, uid, [('product_id','=',ref('product.product_product_sprouting')),('location_dest_id','=',ref('stock_location_customers'))])
ids = self.pool.get('stock.move').search(cr, uid, [('product_id','=',ref('product.product_product_ice')),('location_dest_id','=',ref('stock_location_customers'))])
self.pool.get('stock.move').browse(cr, uid, ids)[0]
context = {'active_model':'stock.move', 'active_id':ids[0],'active_ids': ids}
values = self.default_get(cr, uid, ['location_id','product_id','product_uom','product_qty'], context)
@@ -42,7 +42,7 @@
I check scraped move details.
-
!python {model: stock.move}: |
ids = self.search(cr, uid, [('product_id','=',ref('product.product_product_sprouting')),('location_dest_id','=',ref('stock_location_customers'))])
ids = self.search(cr, uid, [('product_id','=',ref('product.product_product_ice')),('location_dest_id','=',ref('stock_location_customers'))])
for scrap_move in self.browse(cr, uid, ids):
if scrap_move.product_qty == 5.0 and scrap_move.location_dest_id == ref('stock_location_scrapped'):
assert scrap_move.state == 'done',"The scraped move should be in Done state"
@@ -51,7 +51,7 @@
-
!python {model: stock.move }: |
import time
ids = self.pool.get('stock.move').search(cr, uid, [('product_id','=',ref('product.product_product_sprouting')),('location_dest_id','=',ref('stock_location_customers'))])
ids = self.pool.get('stock.move').search(cr, uid, [('product_id','=',ref('product.product_product_ice')),('location_dest_id','=',ref('stock_location_customers'))])
old_move=self.browse(cr,uid,ids)[0]
context = {'active_model': 'stock.move','active_id':ids[0],'active_ids': ids}
tracking_id = self.pool.get('stock.tracking').create(cr, uid, {'name': '0000007', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})