summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorAntony Lesuisse <al@openerp.com>2011-08-05 23:00:49 +0200
committerAntony Lesuisse <al@openerp.com>2011-08-05 23:00:49 +0200
commitd757c2db2c2f2bd53738f0337bd4aeec05bb79a7 (patch)
treef066646d4fdd741818a52d28572c0cb4e94bcc45 /addons
parent11ea949719af986c0c6ccd1b089cd07ba0a96f7d (diff)
parent0b4d5479004576576c4e52b033b6a263729d5f50 (diff)
[MERGE] res_user rework mostly email from user instead of address
bzr revid: al@openerp.com-20110805210049-4ocau2btlq2jg2tx
Diffstat (limited to 'addons')
-rw-r--r--addons/account/security/account_security.xml3
-rw-r--r--addons/account_payment/security/account_payment_security.xml3
-rw-r--r--addons/auction/security/auction_security.xml9
-rw-r--r--addons/base_action_rule/base_action_rule.py15
-rw-r--r--addons/base_calendar/base_calendar.py8
-rw-r--r--addons/base_calendar/wizard/base_calendar_invite_attendee.py6
-rw-r--r--addons/crm/crm.py12
-rw-r--r--addons/crm/crm_action_rule.py4
-rw-r--r--addons/crm/crm_lead_view.xml4
-rw-r--r--addons/crm/crm_opportunity_view.xml4
-rw-r--r--addons/crm/crm_view.xml8
-rw-r--r--addons/crm/security/crm_security.xml14
-rw-r--r--addons/event/security/event_security.xml9
-rw-r--r--addons/hr/hr_department_view.xml8
-rw-r--r--addons/hr/security/hr_security.xml7
-rw-r--r--addons/idea/security/idea_security.xml17
-rw-r--r--addons/lunch/security/lunch_security.xml15
-rw-r--r--addons/mail_gateway/mail_gateway.py3
-rw-r--r--addons/marketing/security/marketing_security.xml5
-rw-r--r--addons/mrp/security/mrp_security.xml7
-rw-r--r--addons/point_of_sale/point_of_sale_view.xml2
-rw-r--r--addons/point_of_sale/security/point_of_sale_security.xml8
-rw-r--r--addons/portal/portal.py25
-rw-r--r--addons/portal/portal_view.xml23
-rw-r--r--addons/portal/res_user_view.xml2
-rw-r--r--addons/portal/security/portal_security.xml9
-rw-r--r--addons/project/project_view.xml13
-rw-r--r--addons/project/security/project_security.xml9
-rw-r--r--addons/project/wizard/project_task_close.py4
-rw-r--r--addons/project_long_term/project_long_term_view.xml2
-rw-r--r--addons/project_mailgate/project_mailgate.py2
-rw-r--r--addons/project_scrum/wizard/project_scrum_email.py2
-rw-r--r--addons/purchase/security/purchase_security.xml9
-rw-r--r--addons/purchase_requisition/security/purchase_tender.xml9
-rw-r--r--addons/sale/security/sale_security.xml9
-rw-r--r--addons/share/share_view.xml19
-rw-r--r--addons/stock/security/stock_security.xml7
-rw-r--r--addons/subscription/security/subcription_security.xml15
-rw-r--r--addons/survey/security/survey_security.xml19
-rw-r--r--addons/survey/survey.py2
40 files changed, 174 insertions, 177 deletions
diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml
index 8a84ad47fc6..5c4c9a0a525 100644
--- a/addons/account/security/account_security.xml
+++ b/addons/account/security/account_security.xml
@@ -4,12 +4,13 @@
<record id="group_account_invoice" model="res.groups">
<field name="name">Accounting / Invoicing &amp; 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">
diff --git a/addons/account_payment/security/account_payment_security.xml b/addons/account_payment/security/account_payment_security.xml
index 872d9d02a92..4bae0c30ce6 100644
--- a/addons/account_payment/security/account_payment_security.xml
+++ b/addons/account_payment/security/account_payment_security.xml
@@ -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>
diff --git a/addons/auction/security/auction_security.xml b/addons/auction/security/auction_security.xml
index 1fc69bb314f..3caf93a2430 100644
--- a/addons/auction/security/auction_security.xml
+++ b/addons/auction/security/auction_security.xml
@@ -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> \ No newline at end of file
+</openerp>
diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py
index 80c1ab464f1..2db23e75893 100644
--- a/addons/base_action_rule/base_action_rule.py
+++ b/addons/base_action_rule/base_action_rule.py
@@ -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(',')
diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py
index 5f24b08884a..a128e18fcc1 100644
--- a/addons/base_calendar/base_calendar.py
+++ b/addons/base_calendar/base_calendar.py
@@ -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),
diff --git a/addons/base_calendar/wizard/base_calendar_invite_attendee.py b/addons/base_calendar/wizard/base_calendar_invite_attendee.py
index 7d5b26026b5..a429db8e925 100644
--- a/addons/base_calendar/wizard/base_calendar_invite_attendee.py
+++ b/addons/base_calendar/wizard/base_calendar_invite_attendee.py
@@ -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']}
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index 0b1e8db7bbb..f6d3964cf0b 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -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
diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py
index 6eb3de3c35f..31dcc0be56a 100644
--- a/addons/crm/crm_action_rule.py
+++ b/addons/crm/crm_action_rule.py
@@ -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)
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index 0159141eb1c..ecd8e07734e 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -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')]"/>
diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml
index 353eefb8f1b..f7afc531646 100644
--- a/addons/crm/crm_opportunity_view.xml
+++ b/addons/crm/crm_opportunity_view.xml
@@ -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')]"/>
diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml
index d5c798279fb..5b8abc77461 100644
--- a/addons/crm/crm_view.xml
+++ b/addons/crm/crm_view.xml
@@ -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>
diff --git a/addons/crm/security/crm_security.xml b/addons/crm/security/crm_security.xml
index 78018a4031b..45b7ccb017e 100644
--- a/addons/crm/security/crm_security.xml
+++ b/addons/crm/security/crm_security.xml
@@ -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">
diff --git a/addons/event/security/event_security.xml b/addons/event/security/event_security.xml
index 648662911d2..c3c70c94d93 100644
--- a/addons/event/security/event_security.xml
+++ b/addons/event/security/event_security.xml
@@ -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>
diff --git a/addons/hr/hr_department_view.xml b/addons/hr/hr_department_view.xml
index 947aca2d2ce..9fdb64651f5 100644
--- a/addons/hr/hr_department_view.xml
+++ b/addons/hr/hr_department_view.xml
@@ -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>
diff --git a/addons/hr/security/hr_security.xml b/addons/hr/security/hr_security.xml
index aba7d4b45e1..aadadd224e9 100644
--- a/addons/hr/security/hr_security.xml
+++ b/addons/hr/security/hr_security.xml
@@ -2,12 +2,13 @@
<openerp>
<data noupdate="1">
+ <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>
- <record id="base.group_hr_user" model="res.groups">
- <field name="name">Human Resources / Officer</field>
- </record>
</data>
</openerp>
diff --git a/addons/idea/security/idea_security.xml b/addons/idea/security/idea_security.xml
index 4b060c51e6c..344cbc64292 100644
--- a/addons/idea/security/idea_security.xml
+++ b/addons/idea/security/idea_security.xml
@@ -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>
diff --git a/addons/lunch/security/lunch_security.xml b/addons/lunch/security/lunch_security.xml
index e042ac0c594..e84cdb41c0d 100644
--- a/addons/lunch/security/lunch_security.xml
+++ b/addons/lunch/security/lunch_security.xml
@@ -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>
diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py
index 4fa70484666..3afc3fb6ba0 100644
--- a/addons/mail_gateway/mail_gateway.py
+++ b/addons/mail_gateway/mail_gateway.py
@@ -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,
diff --git a/addons/marketing/security/marketing_security.xml b/addons/marketing/security/marketing_security.xml
index 06cf40772f4..344e562eb67 100644
--- a/addons/marketing/security/marketing_security.xml
+++ b/addons/marketing/security/marketing_security.xml
@@ -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>
diff --git a/addons/mrp/security/mrp_security.xml b/addons/mrp/security/mrp_security.xml
index 1cc4c5cea9b..94f79769268 100644
--- a/addons/mrp/security/mrp_security.xml
+++ b/addons/mrp/security/mrp_security.xml
@@ -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">
diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml
index 1435f6cc2b6..b0434718a8c 100644
--- a/addons/point_of_sale/point_of_sale_view.xml
+++ b/addons/point_of_sale/point_of_sale_view.xml
@@ -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>
diff --git a/addons/point_of_sale/security/point_of_sale_security.xml b/addons/point_of_sale/security/point_of_sale_security.xml
index 9a90b4d4b6f..14c9e96df9e 100644
--- a/addons/point_of_sale/security/point_of_sale_security.xml
+++ b/addons/point_of_sale/security/point_of_sale_security.xml
@@ -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>
diff --git a/addons/portal/portal.py b/addons/portal/portal.py
index 78483d6a1f1..1c7f84c363a 100644
--- a/addons/portal/portal.py
+++ b/addons/portal/portal.py
@@ -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) """
diff --git a/addons/portal/portal_view.xml b/addons/portal/portal_view.xml
index d43c6115ad6..a6a780fdf16 100644
--- a/addons/portal/portal_view.xml
+++ b/addons/portal/portal_view.xml
@@ -43,11 +43,20 @@ 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"/>
<field name="parent_menu_id"
@@ -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>
diff --git a/addons/portal/res_user_view.xml b/addons/portal/res_user_view.xml
index 716493f2787..492c2ec5559 100644
--- a/addons/portal/res_user_view.xml
+++ b/addons/portal/res_user_view.xml
@@ -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>
diff --git a/addons/portal/security/portal_security.xml b/addons/portal/security/portal_security.xml
index 015a390cdae..4850cb7805b 100644
--- a/addons/portal/security/portal_security.xml
+++ b/addons/portal/security/portal_security.xml
@@ -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>
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 85cde448c6d..731134d0cc6 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -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', '&lt;&gt;', 'cancelled'),('state', '&lt;&gt;', '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"/>
diff --git a/addons/project/security/project_security.xml b/addons/project/security/project_security.xml
index b51a5a9c89a..62f74f51d1b 100644
--- a/addons/project/security/project_security.xml
+++ b/addons/project/security/project_security.xml
@@ -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>
diff --git a/addons/project/wizard/project_task_close.py b/addons/project/wizard/project_task_close.py
index 010bba9e52b..627864820f6 100644
--- a/addons/project/wizard/project_task_close.py
+++ b/addons/project/wizard/project_task_close.py
@@ -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!"))
diff --git a/addons/project_long_term/project_long_term_view.xml b/addons/project_long_term/project_long_term_view.xml
index b720da13654..819fdbd7542 100644
--- a/addons/project_long_term/project_long_term_view.xml
+++ b/addons/project_long_term/project_long_term_view.xml
@@ -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"/>
diff --git a/addons/project_mailgate/project_mailgate.py b/addons/project_mailgate/project_mailgate.py
index 66eaa2e85fa..2325d533c03 100644
--- a/addons/project_mailgate/project_mailgate.py
+++ b/addons/project_mailgate/project_mailgate.py
@@ -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
diff --git a/addons/project_scrum/wizard/project_scrum_email.py b/addons/project_scrum/wizard/project_scrum_email.py
index ae8ba092981..f2e8dd79446 100644
--- a/addons/project_scrum/wizard/project_scrum_email.py
+++ b/addons/project_scrum/wizard/project_scrum_email.py
@@ -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')
diff --git a/addons/purchase/security/purchase_security.xml b/addons/purchase/security/purchase_security.xml
index e1149c91466..a67c675b089 100644
--- a/addons/purchase/security/purchase_security.xml
+++ b/addons/purchase/security/purchase_security.xml
@@ -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">
diff --git a/addons/purchase_requisition/security/purchase_tender.xml b/addons/purchase_requisition/security/purchase_tender.xml
index 595b71008ef..af8a1330e2d 100644
--- a/addons/purchase_requisition/security/purchase_tender.xml
+++ b/addons/purchase_requisition/security/purchase_tender.xml
@@ -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"/>
diff --git a/addons/sale/security/sale_security.xml b/addons/sale/security/sale_security.xml
index dc7e2ce3776..bed44a8d726 100644
--- a/addons/sale/security/sale_security.xml
+++ b/addons/sale/security/sale_security.xml
@@ -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">
diff --git a/addons/share/share_view.xml b/addons/share/share_view.xml
index 4b93e4a52ff..98a10a3cec8 100644
--- a/addons/share/share_view.xml
+++ b/addons/share/share_view.xml
@@ -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>
diff --git a/addons/stock/security/stock_security.xml b/addons/stock/security/stock_security.xml
index 717486413c6..389d62e8ce0 100644
--- a/addons/stock/security/stock_security.xml
+++ b/addons/stock/security/stock_security.xml
@@ -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 -->
diff --git a/addons/subscription/security/subcription_security.xml b/addons/subscription/security/subcription_security.xml
index 70c648380d5..e84cdb41c0d 100644
--- a/addons/subscription/security/subcription_security.xml
+++ b/addons/subscription/security/subcription_security.xml
@@ -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>
diff --git a/addons/survey/security/survey_security.xml b/addons/survey/security/survey_security.xml
index e76f5bce1f5..7b6c43ed2bc 100644
--- a/addons/survey/security/survey_security.xml
+++ b/addons/survey/security/survey_security.xml
@@ -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>
diff --git a/addons/survey/survey.py b/addons/survey/survey.py
index 74d15382670..bd27f313d82 100644
--- a/addons/survey/survey.py
+++ b/addons/survey/survey.py
@@ -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()