From ed6a30946e8f3b7898c1328bc0e8a23cb23455d2 Mon Sep 17 00:00:00 2001 From: "Jitendra Prajapati (OpenERP)" Date: Fri, 6 Dec 2013 19:14:16 +0530 Subject: [PATCH] [IMP/FIX]create demo data. No Rule matching this procurement. remove brim warehouse and Birmingham shop location bzr revid: prajapatijitendra7969@gmail.com-20131206134416-9ian7wk7ipqev4fn --- addons/purchase/purchase_demo.xml | 24 +++ addons/stock/stock_demo.xml | 16 +- addons/stock/stock_demo.yml | 249 ++++++++++++++++++++-- addons/stock/stock_location_demo_cpu1.xml | 1 + 4 files changed, 252 insertions(+), 38 deletions(-) diff --git a/addons/purchase/purchase_demo.xml b/addons/purchase/purchase_demo.xml index c68ee8775bb..b1b1f808cba 100644 --- a/addons/purchase/purchase_demo.xml +++ b/addons/purchase/purchase_demo.xml @@ -17,6 +17,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/stock/stock_demo.xml b/addons/stock/stock_demo.xml index 6579628f83f..f10248d27a4 100644 --- a/addons/stock/stock_demo.xml +++ b/addons/stock/stock_demo.xml @@ -226,14 +226,7 @@ Your Company, Chicago shop - - - - - internal - - Your Company, Birmingham shop - + @@ -249,13 +242,6 @@ Chic - - Birmingham Warehouse - - - - Birm - diff --git a/addons/stock/stock_demo.yml b/addons/stock/stock_demo.yml index 0f365382f69..b71040f0f3b 100644 --- a/addons/stock/stock_demo.yml +++ b/addons/stock/stock_demo.yml @@ -1,16 +1,23 @@ - - !record {model: stock.location, id: location_refrigerator}: - name: Refrigerator - usage: internal -- - !record {model: stock.location, id: location_delivery_counter}: - name: Delivery Counter - usage: internal + !python {model: ir.model.data}: | + main_warehouse = self.pool.get('stock.warehouse').browse(cr, uid, ref('stock_warehouse_shop0'), context=context) + + #create xml ids for demo data that are widely used in tests or in other codes, for more convenience + xml_references = [ + {'name':'chi_picking_type_in','module':'stock', 'model':'stock.picking.type','res_id':main_warehouse.in_type_id.id}, + {'name':'chi_picking_type_out','module':'stock', 'model':'stock.picking.type','res_id':main_warehouse.out_type_id.id}, + ] + for xml_record in xml_references: + xml_ids = self.search(cr, uid, [('module', '=', xml_record['module']), ('model', '=', xml_record['model']), ('name', '=', xml_record['name'])], context=context) + if not xml_ids: + self.create(cr, uid, xml_record, context=context) + #avoid the xml id and the associated resource being dropped by the orm by manually making a hit on it + self._update_dummy(cr, uid, xml_record['model'], xml_record['module'], xml_record['name']) - !record {model: stock.location, id: location_refrigerator_small}: name: Small Refrigerator usage: internal - location_id: location_refrigerator + location_id: stock_location_14 - !record {model: stock.location, id: location_opening}: name: opening @@ -19,12 +26,6 @@ !record {model: stock.location, id: location_convenience_shop}: name: Convenient Store usage: supplier -- - !record {model: stock.warehouse, id: warehouse_icecream}: - name: Ice Cream Shop - code: ICE - lot_stock_id: location_refrigerator - code: Cream - !record {model: product.product, id: product_icecream}: default_code: 001 @@ -56,7 +57,7 @@ inventory_id: stock_inventory_icecream product_qty: 50.0 prod_lot_id: lot_icecream_0 - location_id: location_refrigerator + location_id: stock_location_14 - !record {model: stock.inventory.line, id: stock_inventory_line_icecream_lot1}: product_id: product_icecream @@ -64,16 +65,61 @@ inventory_id: stock_inventory_icecream product_qty: 40.0 prod_lot_id: lot_icecream_1 - location_id: location_refrigerator + location_id: stock_location_14 - Create STOCK_MOVE for OUT - - !record {model: stock.move, id: outgoing_shipment_icecream}: - product_id: product_icecream - product_uom: product.product_uom_kgm - product_uom_qty: 130.0 - location_id: location_refrigerator - location_dest_id: location_delivery_counter + !record {model: stock.picking, id: outgoing_shipment_main_warehouse}: + picking_type_id: stock.picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_27 + product_uom: product.product_uom_unit + product_uom_qty: 15.0 + picking_type_id: stock.picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers +- + !record {model: stock.picking, id: outgoing_shipment_main_warehouse1}: + picking_type_id: stock.picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_6 + product_uom: product.product_uom_unit + product_uom_qty: 180.0 + picking_type_id: stock.picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers + pack_operation_ids: + - product_id: product.product_product_48 + product_qty: 100 + product_uom_id: product.product_uom_unit +- + !record {model: stock.picking, id: outgoing_shipment_main_warehouse2}: + picking_type_id: stock.picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_31 + product_uom: product.product_uom_unit + product_uom_qty: 45.0 + picking_type_id: stock.picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers +- + !record {model: stock.picking, id: outgoing_shipment_main_warehouse3}: + picking_type_id: stock.picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_5 + product_uom: product.product_uom_unit + product_uom_qty: 75.0 + picking_type_id: stock.picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers - Create STOCK_PICKING for IN - @@ -88,4 +134,161 @@ product_uom_qty: 50.0 picking_type_id: stock.picking_type_in location_id: location_convenience_shop - location_dest_id: location_refrigerator + location_dest_id: stock_location_14 +- + !record {model: stock.picking, id: incomming_shipment1}: + picking_type_id: stock.picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_48 + product_uom: product.product_uom_unit + product_uom_qty: 35.0 + picking_type_id: stock.picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock +- + !record {model: stock.picking, id: incomming_shipment2}: + picking_type_id: stock.picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_22 + product_uom: product.product_uom_unit + product_uom_qty: 125.0 + picking_type_id: stock.picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock +- + !record {model: stock.picking, id: incomming_shipment3}: + picking_type_id: stock.picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_10 + product_uom: product.product_uom_unit + product_uom_qty: 120.0 + picking_type_id: stock.picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock +- + !record {model: stock.picking, id: incomming_shipment4}: + picking_type_id: stock.picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_31 + product_uom: product.product_uom_unit + product_uom_qty: 50.0 + picking_type_id: stock.picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock +- + Create STOCK_PICKING_IN for Chicago Warehouse +- + !record {model: stock.picking, id: incomming_chicago_warehouse}: + picking_type_id: chi_picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_9 + product_uom: product.product_uom_unit + product_uom_qty: 25.0 + picking_type_id: chi_picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock +- + !record {model: stock.picking, id: incomming_chicago_warehouse1}: + picking_type_id: chi_picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_48 + product_uom: product.product_uom_unit + product_uom_qty: 180.0 + picking_type_id: chi_picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock + state: done + pack_operation_ids: + - product_id: product.product_product_48 + product_qty: 100 + product_uom_id: product.product_uom_unit +- + !record {model: stock.picking, id: incomming_chicago_warehouse2}: + picking_type_id: chi_picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_32 + product_uom: product.product_uom_unit + product_uom_qty: 45.0 + picking_type_id: chi_picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock +- + !record {model: stock.picking, id: incomming_chicago_warehouse3}: + picking_type_id: chi_picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_22 + product_uom: product.product_uom_unit + product_uom_qty: 75.0 + picking_type_id: chi_picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock +- + Create STOCK_PICKING_OUT for Chicago Warehouse +- + !record {model: stock.picking, id: outgoing_chicago_warehouse}: + picking_type_id: chi_picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_27 + product_uom: product.product_uom_unit + product_uom_qty: 15.0 + picking_type_id: chi_picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers +- + !record {model: stock.picking, id: outgoing_chicago_warehouse1}: + picking_type_id: chi_picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_6 + product_uom: product.product_uom_unit + product_uom_qty: 180.0 + picking_type_id: chi_picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers + pack_operation_ids: + - product_id: product.product_product_48 + product_qty: 100 + product_uom_id: product.product_uom_unit +- + !record {model: stock.picking, id: outgoing_chicago_warehouse2}: + picking_type_id: chi_picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_31 + product_uom: product.product_uom_unit + product_uom_qty: 45.0 + picking_type_id: chi_picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers +- + !record {model: stock.picking, id: outgoing_chicago_warehouse3}: + picking_type_id: chi_picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_5 + product_uom: product.product_uom_unit + product_uom_qty: 75.0 + picking_type_id: chi_picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers \ No newline at end of file diff --git a/addons/stock/stock_location_demo_cpu1.xml b/addons/stock/stock_location_demo_cpu1.xml index f738f1e4faa..f23df5bf78c 100644 --- a/addons/stock/stock_location_demo_cpu1.xml +++ b/addons/stock/stock_location_demo_cpu1.xml @@ -6,6 +6,7 @@ Quality Location + True