[FIX] stock: removed unecessary demo data for company2 (Brimingham), stock locations + fixed location used in stock move

bzr revid: qdp-launchpad@openerp.com-20131212095512-4af332hwtht0865e
This commit is contained in:
Quentin (OpenERP) 2013-12-12 10:55:12 +01:00
parent ebf0c80a00
commit 7130496dcb
3 changed files with 16 additions and 70 deletions

View File

@ -35,7 +35,7 @@ class TestMrpMulticompany(common.TransactionCase):
model, group_user_id = self.registry('ir.model.data').get_object_reference(cr, uid, 'base', 'group_user')
model, group_stock_manager_id = self.registry('ir.model.data').get_object_reference(cr, uid, 'stock', 'group_stock_manager')
model, company_2_id = self.registry('ir.model.data').get_object_reference(cr, uid, 'stock', 'res_company_2')
model, company_2_id = self.registry('ir.model.data').get_object_reference(cr, uid, 'stock', 'res_company_1')
self.multicompany_user_id = self.res_users.create(cr, uid,
{'name': 'multicomp', 'login': 'multicomp',
'groups_id': [(6, 0, [group_user_id, group_stock_manager_id])],

View File

@ -188,53 +188,6 @@
<field name="name">Your Company, Chicago shop</field>
</record>
<!-- Child Company 2-->
<record id="res_partner_company_2" model="res.partner">
<field name="name">Your Company, Birmingham shop</field>
<field eval="1" name="customer"/>
<field eval="1" name="supplier"/>
<field eval="1" name="active"/>
<field name="is_company">1</field>
<field name="street">82-85 Academy Avenue</field>
<field name="city">Birmingham</field>
<field name="zip">B46 3AG</field>
<field model="res.country" name="country_id" search="[('code','ilike','gb')]"/>
<field name="phone">+44 121 690 4596</field>
<field name="email">birmingham@yourcompany.com</field>
<field name="website">www.yourcompany.com</field>
</record>
<record id="res_partner_address_40" model="res.partner">
<field name="name">Donald Thompson</field>
<field name="parent_id" ref="res_partner_company_2"/>
<field name="use_parent_address" eval="1"/>
</record>
<record id="res_company_2" model="res.company">
<field name="currency_id" ref="base.GBP"/>
<field name="partner_id" ref="res_partner_company_2"/>
<field name="parent_id" ref="base.main_company"/>
<field name="name">Your Company, Birmingham shop</field>
</record>
<!--TOCHECK-->
<record id="stock_location_shop0" model="stock.location">
<field model="res.partner" name="partner_id" search="[('name','=','Fabien')]"/>
<field name="location_id" ref="stock.stock_location_locations"/>
<field name="company_id" ref="res_company_1"/>
<field name="usage">internal</field>
<field eval="1" name="active"/>
<field name="name">Your Company, Chicago shop</field>
</record>
<record id="stock_location_intermediatelocation0" model="stock.location">
<field name="partner_id" ref="base.main_partner"/>
<field name="location_id" ref="stock.stock_location_locations_partner"/>
<field name="usage">transit</field>
<field name="name">Internal Shippings</field>
<field name="company_id" eval="False"/>
</record>
<record id="stock_warehouse_shop0" model="stock.warehouse">
<field name="name">Chicago Warehouse</field>
<field name="lot_stock_id" ref="stock_location_shop0"/>

View File

@ -1,11 +1,12 @@
-
!python {model: ir.model.data}: |
main_warehouse = self.pool.get('stock.warehouse').browse(cr, uid, ref('stock_warehouse_shop0'), context=context)
chicago_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},
{'name':'chi_picking_type_in','module':'stock', 'model':'stock.picking.type','res_id': chicago_warehouse.in_type_id.id},
{'name':'chi_picking_type_out','module':'stock', 'model':'stock.picking.type','res_id': chicago_warehouse.out_type_id.id},
{'name':'stock_location_shop0','module':'stock', 'model':'stock.location','res_id': chicago_warehouse.lot_stock_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)
@ -18,14 +19,6 @@
name: Small Refrigerator
usage: internal
location_id: stock_location_14
-
!record {model: stock.location, id: location_opening}:
name: opening
usage: inventory
-
!record {model: stock.location, id: location_convenience_shop}:
name: Convenient Store
usage: supplier
-
!record {model: product.product, id: product_icecream}:
default_code: 001
@ -36,7 +29,7 @@
standard_price: 70.0
uom_id: product.product_uom_kgm
uom_po_id: product.product_uom_kgm
property_stock_inventory: location_opening
property_stock_inventory: location_inventory
description: Ice cream can be mass-produced and thus is widely available in developed parts of the world. Ice cream can be purchased in large cartons (vats and squrounds) from supermarkets and grocery stores, in smaller quantities from ice cream shops, convenience stores, and milk bars, and in individual servings from small carts or vans at public events.
-
!record {model: stock.production.lot, id: lot_icecream_0}:
@ -135,7 +128,7 @@
product_uom: product.product_uom_kgm
product_uom_qty: 50.0
picking_type_id: stock.picking_type_in
location_id: location_convenience_shop
location_id: stock_location_suppliers
location_dest_id: stock_location_14
-
!record {model: stock.picking, id: incomming_shipment1}:
@ -198,7 +191,7 @@
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
location_dest_id: stock.stock_location_shop0
-
!record {model: stock.picking, id: incomming_chicago_warehouse1}:
picking_type_id: chi_picking_type_in
@ -210,7 +203,7 @@
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
location_dest_id: stock.stock_location_shop0
state: done
pack_operation_ids:
- product_id: product.product_product_48
@ -227,7 +220,7 @@
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
location_dest_id: stock.stock_location_shop0
-
!record {model: stock.picking, id: incomming_chicago_warehouse3}:
picking_type_id: chi_picking_type_in
@ -240,7 +233,7 @@
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
location_dest_id: stock.stock_location_shop0
-
Create STOCK_PICKING_OUT for Chicago Warehouse
-
@ -253,7 +246,7 @@
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_id: stock.stock_location_shop0
location_dest_id: stock.stock_location_customers
-
!record {model: stock.picking, id: outgoing_chicago_warehouse1}:
@ -265,7 +258,7 @@
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_id: stock.stock_location_shop0
location_dest_id: stock.stock_location_customers
pack_operation_ids:
- product_id: product.product_product_6
@ -281,7 +274,7 @@
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_id: stock.stock_location_shop0
location_dest_id: stock.stock_location_customers
-
!record {model: stock.picking, id: outgoing_chicago_warehouse3}:
@ -293,7 +286,7 @@
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_id: stock.stock_location_shop0
location_dest_id: stock.stock_location_customers
-
!python {model: stock.picking}: |
@ -303,4 +296,4 @@
record_chi_out = self.browse(cr, uid, ref('outgoing_chicago_warehouse1'), context=context)
if record.state != 'done' and record_chi_in.state != 'done' and record_chi_out.state != 'done':
self.force_assign(cr, uid, [ref('outgoing_shipment_main_warehouse'),ref('outgoing_chicago_warehouse3'),ref('outgoing_shipment_main_warehouse2')], context=context)
self.do_transfer(cr, uid, [ref('outgoing_shipment_main_warehouse1'),ref('incomming_chicago_warehouse1'),ref('outgoing_chicago_warehouse1')], context=context)
self.do_transfer(cr, uid, [ref('outgoing_shipment_main_warehouse1'),ref('incomming_chicago_warehouse1'),ref('outgoing_chicago_warehouse1')], context=context)