[MERGE] res_user rework mostly email from user instead of address
bzr revid: al@openerp.com-20110805210049-4ocau2btlq2jg2tx
This commit is contained in:
@@ -4,12 +4,13 @@
|
||||
<record id="group_account_invoice" model="res.groups">
|
||||
<field name="name">Accounting / Invoicing & Payments</field>
|
||||
</record>
|
||||
|
||||
<record id="group_account_user" model="res.groups" context="{'noadmin':True}">
|
||||
<field name="name">Accounting / Accountant</field>
|
||||
<field name="implied_ids" eval="[(4, ref('group_account_invoice'))]"/>
|
||||
</record>
|
||||
<record id="group_account_manager" model="res.groups" context="{'noadmin':True}">
|
||||
<field name="name">Accounting / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('group_account_user'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="account_move_comp_rule" model="ir.rule">
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
<record id="group_account_payment" model="res.groups">
|
||||
<field name="name">Accounting / Payments</field>
|
||||
</record>
|
||||
<record id="account.group_account_invoice" model="res.groups">
|
||||
<field name="implied_ids" eval="[(4, ref('group_account_payment'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="payment_mode_comp_rule" model="ir.rule">
|
||||
<field name="name">Payment Mode company rule</field>
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
|
||||
<record id="group_auction_manager" model="res.groups">
|
||||
<field name="name">Auction / Manager</field>
|
||||
</record>
|
||||
<record id="group_auction_user" model="res.groups">
|
||||
<field name="name">Auction / User</field>
|
||||
</record>
|
||||
<record id="group_auction_manager" model="res.groups">
|
||||
<field name="name">Auction / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('group_auction_user'))]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
||||
|
||||
@@ -278,9 +278,9 @@ the rule to mark CC(mail to any other person defined in actions)."),
|
||||
'object_description': hasattr(obj, 'description') and obj.description or False,
|
||||
'object_user': hasattr(obj, 'user_id') and (obj.user_id and obj.user_id.name) or '/',
|
||||
'object_user_email': hasattr(obj, 'user_id') and (obj.user_id and \
|
||||
obj.user_id.address_id and obj.user_id.address_id.email) or '/',
|
||||
'object_user_phone': hasattr(obj, 'user_id') and (obj.user_id and\
|
||||
obj.user_id.address_id and obj.user_id.address_id.phone) or '/',
|
||||
obj.user_id.user_email) or '/',
|
||||
'object_user_phone': hasattr(obj, 'partner_address_id') and (obj.partner_address_id and \
|
||||
obj.partner_address_id.phone) or '/',
|
||||
'partner': hasattr(obj, 'partner_id') and (obj.partner_id and obj.partner_id.name) or '/',
|
||||
'partner_email': hasattr(obj, 'partner_address_id') and (obj.partner_address_id and\
|
||||
obj.partner_address_id.email) or '/',
|
||||
@@ -304,9 +304,8 @@ the rule to mark CC(mail to any other person defined in actions)."),
|
||||
|
||||
body = self.format_mail(obj, body)
|
||||
if not emailfrom:
|
||||
if hasattr(obj, 'user_id') and obj.user_id and obj.user_id.address_id and\
|
||||
obj.user_id.address_id.email:
|
||||
emailfrom = obj.user_id.address_id.email
|
||||
if hasattr(obj, 'user_id') and obj.user_id and obj.user_id.user_email:
|
||||
emailfrom = obj.user_id.user_email
|
||||
|
||||
name = '[%d] %s' % (obj.id, tools.ustr(obj.name))
|
||||
emailfrom = tools.ustr(emailfrom)
|
||||
@@ -404,8 +403,8 @@ the rule to mark CC(mail to any other person defined in actions)."),
|
||||
|
||||
emails = []
|
||||
if hasattr(obj, 'user_id') and action.act_mail_to_user:
|
||||
if obj.user_id and obj.user_id.address_id:
|
||||
emails.append(obj.user_id.address_id.email)
|
||||
if obj.user_id:
|
||||
emails.append(obj.user_id.user_email)
|
||||
|
||||
if action.act_mail_to_watchers:
|
||||
emails += (action.act_email_cc or '').split(',')
|
||||
|
||||
@@ -245,7 +245,7 @@ class calendar_attendee(osv.osv):
|
||||
continue
|
||||
else:
|
||||
result[id][name] = self._get_address(attdata.sent_by_uid.name, \
|
||||
attdata.sent_by_uid.address_id.email)
|
||||
attdata.sent_by_uid.user_email)
|
||||
|
||||
if name == 'cn':
|
||||
if attdata.user_id:
|
||||
@@ -535,7 +535,7 @@ property or property parameter."),
|
||||
return {'value': {'email': ''}}
|
||||
usr_obj = self.pool.get('res.users')
|
||||
user = usr_obj.browse(cr, uid, user_id, *args)
|
||||
return {'value': {'email': user.address_id.email, 'availability':user.availability}}
|
||||
return {'value': {'email': user.user_email, 'availability':user.availability}}
|
||||
|
||||
def do_tentative(self, cr, uid, ids, context=None, *args):
|
||||
""" Makes event invitation as Tentative
|
||||
@@ -889,9 +889,9 @@ From:
|
||||
|
||||
""" % (alarm.name, alarm.trigger_date, alarm.description, \
|
||||
alarm.user_id.name, alarm.user_id.signature)
|
||||
mail_to = [alarm.user_id.address_id.email]
|
||||
mail_to = [alarm.user_id.user_email]
|
||||
for att in alarm.attendee_ids:
|
||||
mail_to.append(att.user_id.address_id.email)
|
||||
mail_to.append(att.user_id.user_email)
|
||||
if mail_to:
|
||||
tools.email_send(
|
||||
tools.config.get('email_from', False),
|
||||
|
||||
@@ -98,12 +98,12 @@ send an Email to Invited Person')
|
||||
user = user_obj.browse(cr, uid, user_id)
|
||||
res = {
|
||||
'user_id': user_id,
|
||||
'email': user.address_id.email
|
||||
'email': user.user_email
|
||||
}
|
||||
res.update(ref)
|
||||
vals.append(res)
|
||||
if user.address_id.email:
|
||||
mail_to.append(user.address_id.email)
|
||||
if user.user_email:
|
||||
mail_to.append(user.user_email)
|
||||
|
||||
elif type == 'external' and datas.get('email'):
|
||||
res = {'email': datas['email']}
|
||||
|
||||
+4
-8
@@ -57,7 +57,6 @@ class crm_base(object):
|
||||
|
||||
"""
|
||||
def _get_default_partner_address(self, cr, uid, context=None):
|
||||
|
||||
"""Gives id of default address for current user
|
||||
:param context: if portal in context is false return false anyway
|
||||
"""
|
||||
@@ -65,7 +64,8 @@ class crm_base(object):
|
||||
context = {}
|
||||
if not context.get('portal'):
|
||||
return False
|
||||
return self.pool.get('res.users').browse(cr, uid, uid, context).address_id.id
|
||||
# was user.address_id.id, but address_id has been removed
|
||||
return False
|
||||
|
||||
def _get_default_partner(self, cr, uid, context=None):
|
||||
"""Gives id of partner for current user
|
||||
@@ -76,9 +76,7 @@ class crm_base(object):
|
||||
if not context.get('portal', False):
|
||||
return False
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
if not user.address_id:
|
||||
return False
|
||||
return user.address_id.partner_id.id
|
||||
return user.company_id.partner_id.id
|
||||
|
||||
def _get_default_email(self, cr, uid, context=None):
|
||||
"""Gives default email address for current user
|
||||
@@ -87,9 +85,7 @@ class crm_base(object):
|
||||
if not context.get('portal', False):
|
||||
return False
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
if not user.address_id:
|
||||
return False
|
||||
return user.address_id.email
|
||||
return user.user_email
|
||||
|
||||
def _get_default_user(self, cr, uid, context=None):
|
||||
"""Gives current user id
|
||||
|
||||
@@ -48,8 +48,8 @@ this if you want the rule to send an email to the partner."),
|
||||
def email_send(self, cr, uid, obj, emails, body, emailfrom=tools.config.get('email_from', False), context=None):
|
||||
body = self.format_mail(obj, body)
|
||||
if not emailfrom:
|
||||
if hasattr(obj, 'user_id') and obj.user_id and obj.user_id.address_id and obj.user_id.address_id.email:
|
||||
emailfrom = obj.user_id.address_id.email
|
||||
if hasattr(obj, 'user_id') and obj.user_id and obj.user_id.user_email:
|
||||
emailfrom = obj.user_id.user_email
|
||||
|
||||
name = '[%d] %s' % (obj.id, tools.ustr(obj.name))
|
||||
emailfrom = tools.ustr(emailfrom)
|
||||
|
||||
@@ -309,8 +309,8 @@
|
||||
<search string="Search Leads">
|
||||
<filter icon="terp-check"
|
||||
string="Current"
|
||||
name="current" help="Draft and Open Leads"
|
||||
domain="[('state','in',('draft','open'))]"/>
|
||||
name="current" help="Draft, Open and Pending Leads"
|
||||
domain="[('state','in',('draft','open','pending'))]"/>
|
||||
<filter icon="terp-camera_test"
|
||||
string="Open"
|
||||
domain="[('state','=','open')]"/>
|
||||
|
||||
@@ -281,9 +281,9 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Opportunities">
|
||||
<filter icon="terp-check"
|
||||
string="Current" help="Draft and Open Opportunities"
|
||||
string="Current" help="Draft, Open and Pending Opportunities"
|
||||
name="current"
|
||||
domain="[('state','in',('draft','open'))]"/>
|
||||
domain="[('state','in',('draft','open','pending'))]"/>
|
||||
<filter icon="terp-camera_test"
|
||||
string="Open" help="Open Opportunities"
|
||||
domain="[('state','=','open')]"/>
|
||||
|
||||
@@ -350,12 +350,12 @@
|
||||
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<page string="Current Activity" position="inside">
|
||||
<group name="default_filters" position="inside">
|
||||
<field name="context_section_id" completion="1"
|
||||
widget="selection"
|
||||
context="{'user_prefence':True}"
|
||||
readonly="0"/>
|
||||
</page>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -366,9 +366,9 @@
|
||||
<field name="inherit_id" ref="base.view_users_form"/>
|
||||
<field eval="18" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/notebook" position="before">
|
||||
<group name="default_filters" position="inside">
|
||||
<field name="context_section_id" completion="1" widget="selection"/>
|
||||
</xpath>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -2,16 +2,18 @@
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
|
||||
<record id="base.group_sale_manager" model="res.groups">
|
||||
<field name="name">Sales / Manager</field>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_salesman" model="res.groups">
|
||||
<field name="name">Sales / User</field>
|
||||
<field name="name">Sales / User - Own Leads Only</field>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_salesman_all_leads" model="res.groups">
|
||||
<field name="name">Sales / User - See All Leads</field>
|
||||
<field name="name">Sales / User - All Leads</field>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_sale_salesman'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_manager" model="res.groups">
|
||||
<field name="name">Sales / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_sale_salesman_all_leads'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="crm_rule_personal_lead" model="ir.rule">
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="marketing.group_marketing_manager" model="res.groups">
|
||||
<field name="name">Marketing / Manager</field>
|
||||
</record>
|
||||
|
||||
<record id="marketing.group_marketing_user" model="res.groups">
|
||||
<field name="name">Marketing / User</field>
|
||||
</record>
|
||||
|
||||
<record id="marketing.group_marketing_manager" model="res.groups">
|
||||
<field name="name">Marketing / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('marketing.group_marketing_user'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_manager" model="res.groups">
|
||||
<field name="name">Sales / Manager</field>
|
||||
</record>
|
||||
|
||||
@@ -71,9 +71,9 @@
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/notebook" position="before">
|
||||
<group name="default_filters" position="inside">
|
||||
<field name="context_department_id" completion="1" widget="selection" string="Department"/>
|
||||
</xpath>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_department_form_simple_modif_inherited1">
|
||||
@@ -82,9 +82,9 @@
|
||||
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<page string="Current Activity" position="inside">
|
||||
<group name="default_filters" position="inside">
|
||||
<field name="context_department_id" widget="selection" readonly="0"/>
|
||||
</page>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="base.group_hr_manager" model="res.groups">
|
||||
<field name="name">Human Resources / Manager</field>
|
||||
</record>
|
||||
|
||||
<record id="base.group_hr_user" model="res.groups">
|
||||
<field name="name">Human Resources / Officer</field>
|
||||
</record>
|
||||
<record id="base.group_hr_manager" model="res.groups">
|
||||
<field name="name">Human Resources / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_hr_user'))]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data>
|
||||
|
||||
<record model="res.groups" id="base.group_tool_manager">
|
||||
<field name="name">Tools / Manager</field>
|
||||
</record>
|
||||
<record model="res.groups" id="base.group_tool_user">
|
||||
<field name="name">Tools / User</field>
|
||||
</record>
|
||||
<record model="res.groups" id="base.group_tool_user">
|
||||
<field name="name">Tools / User</field>
|
||||
</record>
|
||||
<record model="res.groups" id="base.group_tool_manager">
|
||||
<field name="name">Tools / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_tool_user'))]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
|
||||
<record model="res.groups" id="base.group_tool_manager">
|
||||
<field name="name">Tools / Manager</field>
|
||||
</record>
|
||||
<record model="res.groups" id="base.group_tool_user">
|
||||
<field name="name">Tools / User</field>
|
||||
</record>
|
||||
|
||||
<record model="res.groups" id="base.group_tool_user">
|
||||
<field name="name">Tools / User</field>
|
||||
</record>
|
||||
<record model="res.groups" id="base.group_tool_manager">
|
||||
<field name="name">Tools / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_tool_user'))]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -164,8 +164,7 @@ class mailgate_thread(osv.osv):
|
||||
'description': details or (hasattr(case, 'description') and case.description or False),
|
||||
'email_to': email,
|
||||
'email_from': email_from or \
|
||||
(hasattr(case, 'user_id') and case.user_id and case.user_id.address_id and \
|
||||
case.user_id.address_id.email),
|
||||
(hasattr(case, 'user_id') and case.user_id and case.user_id.user_email),
|
||||
'email_cc': email_cc,
|
||||
'email_bcc': email_bcc,
|
||||
'partner_id': partner_id,
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
<record id="marketing.group_marketing_user" model="res.groups">
|
||||
<field name="name">Marketing / User</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="marketing.group_marketing_manager" model="res.groups">
|
||||
<field name="name">Marketing / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('marketing.group_marketing_user'))]"/>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
|
||||
<record id="group_mrp_manager" model="res.groups">
|
||||
<field name="name">Manufacturing / Manager</field>
|
||||
</record>
|
||||
<record id="group_mrp_user" model="res.groups">
|
||||
<field name="name">Manufacturing / User</field>
|
||||
</record>
|
||||
<record id="group_mrp_manager" model="res.groups">
|
||||
<field name="name">Manufacturing / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('group_mrp_user'))]"/>
|
||||
</record>
|
||||
|
||||
<!-- restrict access to menu -->
|
||||
<record model='ir.ui.menu' id="mrp_Sched_all">
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
<field name="res_model">pos.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_pos_pos_form"/>
|
||||
<field name="domain">[['date_order','>=',time.strftime('%Y-%m-%d')]]</field>
|
||||
<field name="domain">[]</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_pos_order_tree">
|
||||
<field name="name">Sales</field>
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="group_pos_manager" model="res.groups">
|
||||
<field name="name">Point of Sale / Manager</field>
|
||||
</record>
|
||||
<record id="group_pos_user" model="res.groups">
|
||||
<field name="name">Point of Sale / User</field>
|
||||
</record>
|
||||
<record id="group_pos_manager" model="res.groups">
|
||||
<field name="name">Point of Sale / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('group_pos_user'))]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
+9
-16
@@ -37,10 +37,6 @@ class portal(osv.osv):
|
||||
'group_id': fields.many2one('res.groups', required=True, ondelete='cascade',
|
||||
string='Group',
|
||||
help='The group extended by this portal'),
|
||||
'other_group_ids': fields.many2many('res.groups',
|
||||
'portal_group_rel', 'portal_id', 'group_id',
|
||||
string='Other User Groups',
|
||||
help="Those groups are assigned to the portal's users"),
|
||||
'url': fields.char('URL', size=64,
|
||||
help="The url where portal users can connect to the server"),
|
||||
'menu_action_id': fields.many2one('ir.actions.act_window', readonly=True,
|
||||
@@ -70,8 +66,8 @@ class portal(osv.osv):
|
||||
portal_id = super(portal, self).create(cr, uid, values, context)
|
||||
|
||||
# assign menu action and widgets to users
|
||||
if values.get('users') or values.get('other_group_ids') or values.get('menu_action_id'):
|
||||
self._assign_menu_and_groups(cr, uid, [portal_id], context)
|
||||
if values.get('users') or values.get('menu_action_id'):
|
||||
self._assign_menu(cr, uid, [portal_id], context)
|
||||
if values.get('users') or values.get('widget_ids'):
|
||||
self._assign_widgets(cr, uid, [portal_id], context)
|
||||
|
||||
@@ -83,8 +79,8 @@ class portal(osv.osv):
|
||||
super(portal, self).write(cr, uid, ids, values, context)
|
||||
|
||||
# assign menu action and widgets to users
|
||||
if values.get('users') or values.get('other_group_ids') or values.get('menu_action_id'):
|
||||
self._assign_menu_and_groups(cr, uid, ids, context)
|
||||
if values.get('users') or values.get('menu_action_id'):
|
||||
self._assign_menu(cr, uid, ids, context)
|
||||
if values.get('users') or values.get('widget_ids'):
|
||||
self._assign_widgets(cr, uid, ids, context)
|
||||
|
||||
@@ -117,18 +113,15 @@ class portal(osv.osv):
|
||||
|
||||
return True
|
||||
|
||||
def _assign_menu_and_groups(self, cr, uid, ids, context=None):
|
||||
""" assign portal menu and other groups to users of portals (ids) """
|
||||
def _assign_menu(self, cr, uid, ids, context=None):
|
||||
""" assign portal menu to users of portals (ids) """
|
||||
user_obj = self.pool.get('res.users')
|
||||
for p in self.browse(cr, uid, ids, context):
|
||||
# user groups = portal group + other groups
|
||||
group_ids = [p.group_id.id] + [g.id for g in p.other_group_ids]
|
||||
user_values = {'groups_id': [(6, 0, group_ids)]}
|
||||
# user menu action = portal menu action if set in portal
|
||||
if p.menu_action_id:
|
||||
user_values['menu_id'] = p.menu_action_id.id
|
||||
user_ids = [u.id for u in p.users if u.id != 1]
|
||||
user_obj.write(cr, uid, user_ids, user_values, context)
|
||||
user_ids = [u.id for u in p.users if u.id != 1]
|
||||
user_values = {'menu_id': p.menu_action_id.id}
|
||||
user_obj.write(cr, uid, user_ids, user_values, context)
|
||||
|
||||
def _assign_widgets(self, cr, uid, ids, context=None):
|
||||
""" assign portal widgets to users of portals (ids) """
|
||||
|
||||
@@ -43,10 +43,19 @@ the portal's users.
|
||||
<field name="arch" type="xml">
|
||||
<page string="Users" position="before">
|
||||
<page string="Portal">
|
||||
<group colspan="2" col="2">
|
||||
<group colspan="4" col="2">
|
||||
<separator string="Website" colspan="2"/>
|
||||
<field name="url" widget="url"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Widgets assigned to Users" colspan="2"/>
|
||||
<field name="widget_ids" nolabel="1" colspan="2">
|
||||
<tree string="Widgets" editable="bottom">
|
||||
<field name="sequence"/>
|
||||
<field name="widget_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Portal Menu" colspan="2"/>
|
||||
<field name="override_menu"/>
|
||||
@@ -56,18 +65,6 @@ the portal's users.
|
||||
<button name="do_create_menu" type="object"
|
||||
string="Create Parent Menu"/>
|
||||
</group>
|
||||
<separator string="Other Groups assigned to Users" colspan="2"/>
|
||||
<separator string="Widgets assigned to Users" colspan="2"/>
|
||||
<!-- load group_id in order to exclude it from other_group_ids -->
|
||||
<field name="group_id" invisible="1"/>
|
||||
<field name="other_group_ids" nolabel="1" colspan="2"
|
||||
domain="[('id', '!=', group_id)]"/>
|
||||
<field name="widget_ids" nolabel="1" colspan="2">
|
||||
<tree string="Widgets" editable="bottom">
|
||||
<field name="sequence"/>
|
||||
<field name="widget_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</page>
|
||||
</field>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.view_users_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="address_id" position="before">
|
||||
<field name="active" position="before">
|
||||
<field name="partner_id"/>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record id="group_portal_manager" model="res.groups">
|
||||
<field name="name">Portal / Manager</field>
|
||||
<field name="comment">Portal managers have access to the portal definitions, and can easily configure the users, access rights and menus of portal users.</field>
|
||||
</record>
|
||||
<record id="group_portal_officer" model="res.groups">
|
||||
<field name="name">Portal / Officer</field>
|
||||
<field name="comment">Portal officers can create new portal users with the portal wizard.</field>
|
||||
</record>
|
||||
<record id="group_portal_manager" model="res.groups">
|
||||
<field name="name">Portal / Manager</field>
|
||||
<field name="comment">Portal managers have access to the portal definitions, and can easily configure the users, access rights and menus of portal users.</field>
|
||||
<field name="implied_ids" eval="[(4, ref('group_portal_officer'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
<tree string="Members">
|
||||
<field name="name"/>
|
||||
<field name="user_email"/>
|
||||
<field name="address_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
@@ -397,7 +396,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Task Edition">
|
||||
<group col="20" colspan="4">
|
||||
<filter string="Current" domain="[('state','in',('open','draft'))]" name="current" help="Draft and In Progress tasks" icon="terp-check"/>
|
||||
<filter string="Current" domain="[('state','in',('open','draft','pending'))]" name="current" help="Draft, In Progress and Pending Tasks" icon="terp-check"/>
|
||||
<filter string="In Progress" domain="[('state','=','open')]" help="In Progress Tasks" icon="terp-camera_test"/>
|
||||
<filter string="Pending" domain="[('state','=','pending')]" context="{'show_delegated':False}" help="Pending Tasks" icon="terp-gtk-media-pause"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -546,9 +545,9 @@
|
||||
<field name="inherit_id" ref="base.view_users_form"/>
|
||||
<field eval="18" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/notebook" position="before">
|
||||
<group name="default_filters" position="inside">
|
||||
<field name="context_project_id"/>
|
||||
</xpath>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -559,9 +558,9 @@
|
||||
<field name="type">form</field>
|
||||
<field eval="18" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<page string="Current Activity" position="inside">
|
||||
<field name="context_project_id" completion="1" context="{'user_prefence':True}" widget="selection" readonly="0"/>
|
||||
</page>
|
||||
<group name="default_filters" position="inside">
|
||||
<field name="context_project_id" context="{'user_prefence':True}" widget="selection"/>
|
||||
</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"/>
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="group_project_manager" model="res.groups">
|
||||
<field name="name">Project / Manager</field>
|
||||
</record>
|
||||
|
||||
<record id="group_project_user" model="res.groups">
|
||||
<field name="name">Project / User</field>
|
||||
</record>
|
||||
|
||||
<record id="group_project_manager" model="res.groups">
|
||||
<field name="name">Project / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('group_project_user'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_salesman" model="res.groups">
|
||||
<field name="name">Sales / User</field>
|
||||
</record>
|
||||
|
||||
@@ -84,8 +84,8 @@ class project_task_close(osv.osv_memory):
|
||||
elif data.manager_warn or data.partner_warn:
|
||||
project = task.project_id
|
||||
subject = _("Task '%s' Closed") % task.name
|
||||
if task.user_id and task.user_id.address_id and task.user_id.address_id.email:
|
||||
from_adr = task.user_id.address_id.email
|
||||
if task.user_id and task.user_id.user_email:
|
||||
from_adr = task.user_id.user_email
|
||||
signature = task.user_id.signature
|
||||
else:
|
||||
raise osv.except_osv(_('Error'), _("Couldn't send mail because your email address is not configured!"))
|
||||
|
||||
@@ -267,7 +267,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Project Phases">
|
||||
<group colspan="4" col="20">
|
||||
<filter string="Current" domain="[('state','in',('open','draft'))]" name="current" help="Draft and In Progress Phases" icon="terp-check"/>
|
||||
<filter string="Current" domain="[('state','in',('open','draft','pending'))]" name="current" help="Draft, In Progress and Pending Phases" icon="terp-check"/>
|
||||
<filter string="In Progress" name="Progress" domain="[('state','=','open')]" help="In Progress Phases" icon="terp-camera_test"/>
|
||||
<filter string="Pending" domain="[('state','=','pending')]" help="Pending Phases" icon="terp-gtk-media-pause"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
@@ -103,7 +103,7 @@ class project_tasks(osv.osv):
|
||||
else:
|
||||
select = ids
|
||||
for task in self.browse(cr, uid, select, context=context):
|
||||
user_email = (task.user_id and task.user_id.address_id and task.user_id.address_id.email) or False
|
||||
user_email = (task.user_id and task.user_id.user_email) or False
|
||||
res += [(user_email, False, False, task.priority)]
|
||||
if isinstance(ids, (str, int, long)):
|
||||
return len(res) and res[0] or False
|
||||
|
||||
@@ -82,7 +82,7 @@ class project_scrum_email(osv.osv_memory):
|
||||
|
||||
email_from = tools.config.get('email_from', False)
|
||||
user = user_pool.browse(cr, uid, uid, context=context)
|
||||
user_email = email_from or user.address_id.email
|
||||
user_email = email_from or user.user_email
|
||||
|
||||
body = "%s\n" %(data.message)
|
||||
body += "\n%s\n" %_('Tasks since yesterday')
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="group_purchase_manager" model="res.groups">
|
||||
<field name="name">Purchase / Manager</field>
|
||||
</record>
|
||||
<record id="group_purchase_user" model="res.groups">
|
||||
<field name="name">Purchase / User</field>
|
||||
<field name="name">Purchases / User</field>
|
||||
</record>
|
||||
<record id="group_purchase_manager" model="res.groups">
|
||||
<field name="name">Purchases / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('group_purchase_user'))]"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.rule" id="purchase_order_comp_rule">
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="group_purchase_requisition_manager" model="res.groups">
|
||||
<field name="name">Purchase Requisition / Manager</field>
|
||||
</record>
|
||||
|
||||
<record id="group_purchase_requisition_user" model="res.groups">
|
||||
<field name="name">Purchase Requisition / User</field>
|
||||
</record>
|
||||
|
||||
<record id="group_purchase_requisition_manager" model="res.groups">
|
||||
<field name="name">Purchase Requisition / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('group_purchase_requisition_user'))]"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.rule" id="purchase_requisition_comp_rule">
|
||||
<field name="name">Purchase Requisition multi-company</field>
|
||||
<field name="model_id" ref="model_purchase_requisition"/>
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
|
||||
<record id="base.group_sale_manager" model="res.groups">
|
||||
<field name="name">Sales / Manager</field>
|
||||
</record>
|
||||
<record id="base.group_sale_salesman" model="res.groups">
|
||||
<field name="name">Sales / User - Own Leads Only</field>
|
||||
<field name="users" eval="[(4, ref('base.user_root'))]"/>
|
||||
@@ -12,6 +9,12 @@
|
||||
|
||||
<record id="base.group_sale_salesman_all_leads" model="res.groups">
|
||||
<field name="name">Sales / User - All Leads</field>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_sale_salesman'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_manager" model="res.groups">
|
||||
<field name="name">Sales / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_sale_salesman_all_leads'))]"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.menu" id="base.menu_base_partner">
|
||||
|
||||
@@ -1,27 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_groups_form" model="ir.ui.view">
|
||||
<record id="view_groups_form" model="ir.ui.view">
|
||||
<field name="name">res.groups.form</field>
|
||||
<field name="model">res.groups</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.view_groups_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<group name="default_filters" position="inside">
|
||||
<field name="share"/>
|
||||
</field>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_users_form" model="ir.ui.view">
|
||||
<field name="name">res.users.form</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.view_users_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/notebook" position="before">
|
||||
<field name="share"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
|
||||
<record id="group_stock_manager" model="res.groups">
|
||||
<field name="name">Warehouse / Manager</field>
|
||||
</record>
|
||||
<record id="group_stock_user" model="res.groups">
|
||||
<field name="name">Warehouse / User</field>
|
||||
</record>
|
||||
<record id="group_stock_manager" model="res.groups">
|
||||
<field name="name">Warehouse / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('group_stock_user'))]"/>
|
||||
</record>
|
||||
|
||||
<!-- multi -->
|
||||
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
|
||||
<record model="res.groups" id="base.group_tool_manager">
|
||||
<field name="name">Tools / Manager</field>
|
||||
</record>
|
||||
<record model="res.groups" id="base.group_tool_user">
|
||||
<field name="name">Tools / User</field>
|
||||
</record>
|
||||
|
||||
<record model="res.groups" id="base.group_tool_user">
|
||||
<field name="name">Tools / User</field>
|
||||
</record>
|
||||
<record model="res.groups" id="base.group_tool_manager">
|
||||
<field name="name">Tools / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_tool_user'))]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
<record model="res.groups" id="base.group_tool_manager">
|
||||
<field name="name">Tools / Manager</field>
|
||||
</record>
|
||||
<record model="res.groups" id="base.group_tool_user">
|
||||
<field name="name">Tools / User</field>
|
||||
</record>
|
||||
<record model="res.groups" id="base.group_survey_user">
|
||||
<field name="name">Survey / User</field>
|
||||
</record>
|
||||
<record model="res.groups" id="base.group_tool_user">
|
||||
<field name="name">Tools / User</field>
|
||||
</record>
|
||||
<record model="res.groups" id="base.group_tool_manager">
|
||||
<field name="name">Tools / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_tool_user'))]"/>
|
||||
</record>
|
||||
<record model="res.groups" id="base.group_survey_user">
|
||||
<field name="name">Survey / User</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -741,7 +741,7 @@ class survey_request(osv.osv):
|
||||
if user_id:
|
||||
user_obj = self.pool.get('res.users')
|
||||
user = user_obj.browse(cr, uid, user_id, context=context)
|
||||
return {'value': {'email': user.address_id.email}}
|
||||
return {'value': {'email': user.user_email}}
|
||||
return {}
|
||||
|
||||
survey_request()
|
||||
|
||||
Reference in New Issue
Block a user