[FIX] multi-company modifs
bzr revid: fp@tinyerp.com-20090624061142-d4u3fdke67abrbkn
This commit is contained in:
@@ -28,5 +28,5 @@
|
||||
"access_purchase_order_mrp_worker","purchase.order mrp_worker","purchase.model_purchase_order","mrp.group_mrp_user",1,0,0,0
|
||||
"access_purchase_order_line_mrp_worker","purchase.order.line mrp_worker","purchase.model_purchase_order_line","mrp.group_mrp_user",1,0,0,0
|
||||
"access_hr_timesheet_group_mrp_worker","hr.timesheet.group mrp_worker","hr.model_hr_timesheet_group","mrp.group_mrp_user",1,0,0,0
|
||||
"access_mrp_procurement_stock_worker","mrp.procurement stock_worker","model_mrp_procurement","stock.group_stock_user",1,0,0,0
|
||||
"access_mrp_procurement_stock_worker","mrp.procurement stock_worker","model_mrp_procurement","stock.group_stock_user",1,1,1,1
|
||||
"access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0
|
||||
|
||||
|
@@ -295,9 +295,7 @@ class product_template(osv.osv):
|
||||
return False
|
||||
|
||||
_defaults = {
|
||||
'company_id': lambda self, cr, uid, context: \
|
||||
self.pool.get('res.users').browse(cr, uid, uid,
|
||||
context=context).company_id.id,
|
||||
'company_id': lambda self, cr, uid, context: False, # Visible by all
|
||||
'type': lambda *a: 'product',
|
||||
'list_price': lambda *a: 1,
|
||||
'cost_method': lambda *a: 'standard',
|
||||
|
||||
@@ -62,8 +62,10 @@ class product_product(osv.osv):
|
||||
else:
|
||||
location_ids = context['location']
|
||||
else:
|
||||
cr.execute("select lot_stock_id from stock_warehouse")
|
||||
location_ids = [id for (id,) in cr.fetchall()]
|
||||
location_ids = []
|
||||
wids = self.pool.get('stock.warehouse').search(cr, uid, [], context=context)
|
||||
for w in self.pool.get('stock.warehouse').browse(cr, uid, wids, context=context):
|
||||
location_ids.append(w.lot_stock_id.id)
|
||||
|
||||
# build the list of ids of children of the location given by id
|
||||
if context.get('compute_child',True):
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
<record id="stock_location_stock" model="stock.location">
|
||||
<field name="name">Stock</field>
|
||||
<field name="location_id" ref="stock_location_company"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
|
||||
@@ -33,23 +33,28 @@
|
||||
<record id="stock_location_13" model="stock.location">
|
||||
<field name="name">Stock Level 1</field>
|
||||
<field name="location_id" ref="stock_location_stock"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="stock_location_14" model="stock.location">
|
||||
<field name="name">Finished products</field>
|
||||
<field name="location_id" ref="stock_location_13"/>
|
||||
<field model="account.account" name="account_id" search="[('name','=','Merchandise Type B')]"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="stock_location_15" model="stock.location">
|
||||
<field name="name">Sub Products</field>
|
||||
<field name="location_id" ref="stock_location_13"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="stock_location_workshop" model="stock.location">
|
||||
<field name="name">Workshop</field>
|
||||
<field name="location_id" ref="stock_location_stock"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="stock_location_components" model="stock.location">
|
||||
<field name="name">Components</field>
|
||||
<field name="location_id" ref="stock_location_workshop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
|
||||
Reference in New Issue
Block a user