[FIX] product: remove shortcut. it is not seem good implementation.
bzr revid: hmo@tinyerp.com-20100903071018-8bvo1uipzxd0jj2j
This commit is contained in:
parent
0dd8aee3e4
commit
7ca5d63652
|
@ -720,32 +720,5 @@ class pricelist_partnerinfo(osv.osv):
|
|||
}
|
||||
_order = 'min_quantity asc'
|
||||
pricelist_partnerinfo()
|
||||
|
||||
class res_users(osv.osv):
|
||||
_name = 'res.users'
|
||||
_inherit = 'res.users'
|
||||
|
||||
def create(self, cr, uid, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
user_id = super(res_users, self).create(cr, uid, data, context)
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
try:
|
||||
data_id = data_obj._get_id(cr, uid, 'product', 'ir_ui_view_sc_product0')
|
||||
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
||||
copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
|
||||
'user_id': user_id}, context=context)
|
||||
except ValueError:
|
||||
# During a single install of multiple modules, the product_view.xml may
|
||||
# be loaded after this python code is present in the server and called
|
||||
# by other module's res_users.create() calls. So, we have to survive
|
||||
# this and create the user.
|
||||
# One more case is if some admin has deliberately removed this shortcut,
|
||||
# users must still be able to create.
|
||||
logging.getLogger('orm').warning('Skipped Products shortcut for user "%s"', data.get('name','<new'))
|
||||
return user_id
|
||||
|
||||
res_users()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -633,13 +633,5 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="product_template_tree_view"/>
|
||||
</record>
|
||||
|
||||
<record id="ir_ui_view_sc_product0" model="ir.ui.view_sc">
|
||||
<field name="name">Products</field>
|
||||
<field name="resource">ir.ui.menu</field>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="res_id" ref="product.menu_products"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue