[IMP] Removing context_XXX_id for default searches; replaced by save as default search in the new search widget
bzr revid: fp@tinyerp.com-20120521135856-hc0kzrpgrxozpq9r
This commit is contained in:
+1
-20
@@ -224,10 +224,7 @@ class crm_base(object):
|
||||
return uid
|
||||
|
||||
def _get_section(self, cr, uid, context=None):
|
||||
"""Gives section id for current User
|
||||
"""
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
return user.context_section_id.id or False
|
||||
return False
|
||||
|
||||
def onchange_partner_address_id(self, cr, uid, ids, add, email=False):
|
||||
"""This function returns value of partner email based on Partner Address
|
||||
@@ -605,20 +602,4 @@ def _links_get(self, cr, uid, context=None):
|
||||
res = obj.read(cr, uid, ids, ['object', 'name'], context)
|
||||
return [(r['object'], r['name']) for r in res]
|
||||
|
||||
class users(osv.osv):
|
||||
_inherit = 'res.users'
|
||||
_description = "Users"
|
||||
_columns = {
|
||||
'context_section_id': fields.many2one('crm.case.section', 'Sales Team'),
|
||||
}
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
res = super(users, self).create(cr, uid, vals, context=context)
|
||||
section_obj=self.pool.get('crm.case.section')
|
||||
if vals.get('context_section_id'):
|
||||
section_obj.write(cr, uid, [vals['context_section_id']], {'member_ids':[(4, res)]}, context)
|
||||
return res
|
||||
|
||||
users()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -376,32 +376,6 @@
|
||||
groups="base.group_no_one" sequence="15"
|
||||
parent="base.menu_base_config" />
|
||||
|
||||
<record model="ir.ui.view" id="view_users_form_simple_modif_inherited1">
|
||||
<field name="name">view.users.form.crm.modif.inherited1</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<group name="default_filters" position="inside">
|
||||
<field name="context_section_id" completion="1"
|
||||
readonly="0"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_users_form_simple_modif_inherited2" model="ir.ui.view">
|
||||
<field name="name">view.users.form.crm.modif.inherited2</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.view_users_form"/>
|
||||
<field eval="18" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="default_filters" position="inside">
|
||||
<field name="context_section_id" completion="1"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- menu for the working time -->
|
||||
<menuitem action="resource.action_resource_calendar_form" id="menu_action_resource_calendar_form" parent="resource.menu_resource_config" sequence="1"/>
|
||||
|
||||
|
||||
@@ -105,14 +105,5 @@ class ir_action_window(osv.osv):
|
||||
|
||||
ir_action_window()
|
||||
|
||||
class res_users(osv.osv):
|
||||
_inherit = 'res.users'
|
||||
_description = 'User'
|
||||
|
||||
_columns = {
|
||||
'context_department_id': fields.many2one('hr.department', 'Departments'),
|
||||
}
|
||||
|
||||
res_users()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -57,27 +57,5 @@
|
||||
|
||||
<menuitem action="open_module_tree_department" id="menu_hr_department_tree" parent="hr.menu_hr_configuration" sequence="5"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_users_form_inherit">
|
||||
<field name="name">res.users.form</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="default_filters" position="inside">
|
||||
<field name="context_department_id" completion="1" widget="selection" string="Department"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_department_form_simple_modif_inherited1">
|
||||
<field name="name">view.department.form.hr.inherited1</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<group name="default_filters" position="inside">
|
||||
<field name="context_department_id" widget="selection" readonly="0"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -898,7 +898,6 @@ class sugar_import(import_framework):
|
||||
'context_lang' : 'context_lang',
|
||||
'password' : 'password',
|
||||
'.id' : '.id',
|
||||
'context_department_id/id': self.get_users_department,
|
||||
'user_email' : 'email1',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,13 +504,6 @@ def Project():
|
||||
|
||||
project()
|
||||
|
||||
class users(osv.osv):
|
||||
_inherit = 'res.users'
|
||||
_columns = {
|
||||
'context_project_id': fields.many2one('project.project', 'Project')
|
||||
}
|
||||
users()
|
||||
|
||||
class task(osv.osv):
|
||||
_name = "project.task"
|
||||
_description = "Task"
|
||||
|
||||
@@ -745,31 +745,6 @@
|
||||
</record>
|
||||
|
||||
<!-- User Form-->
|
||||
<record id="view_project_users_form_simple" model="ir.ui.view">
|
||||
<field name="name">res.users.project.form1</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.view_users_form"/>
|
||||
<field eval="18" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="default_filters" position="inside">
|
||||
<field name="context_project_id"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_users_form_project_modif_inherited1">
|
||||
<field name="name">view.users.form.project.modif.inherited1</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
|
||||
<field name="type">form</field>
|
||||
<field eval="18" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="default_filters" position="inside">
|
||||
<field name="context_project_id" context="{'user_preference':True}" widget="selection" readonly="0"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
<act_window context="{'search_default_user_id': [active_id], 'default_user_id': active_id}" domain="[('state', '<>', 'cancelled'),('state', '<>', 'done')]" id="act_res_users_2_project_task_opened" name="Assigned Tasks" res_model="project.task" src_model="res.users" view_mode="tree,form,gantt,calendar,graph" view_type="form"/>
|
||||
<act_window context="{'search_default_user_id': [active_id], 'default_user_id': active_id}" domain="[('state', '<>', 'cancelled'),('state', '<>', 'done')]" id="act_res_users_2_project_task_opened" name="Assigned Tasks" res_model="project.task" src_model="res.users" view_mode="tree,form,gantt,calendar,graph" view_type="form"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -140,12 +140,6 @@ class project_issue(crm.crm_case, osv.osv):
|
||||
res[issue.id] = {'progress' : progress}
|
||||
return res
|
||||
|
||||
def _get_project(self, cr, uid, context=None):
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
if user.context_project_id:
|
||||
return user.context_project_id.id
|
||||
return False
|
||||
|
||||
def on_change_project(self, cr, uid, ids, project_id, context=None):
|
||||
return {}
|
||||
|
||||
@@ -233,7 +227,6 @@ class project_issue(crm.crm_case, osv.osv):
|
||||
'section_id': crm.crm_case._get_section,
|
||||
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.helpdesk', context=c),
|
||||
'priority': crm.AVAILABLE_PRIORITIES[2][0],
|
||||
'project_id':_get_project,
|
||||
'categ_id' : lambda *a: False,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user