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 @@ Accounting / Invoicing & Payments - Accounting / Accountant + Accounting / Manager + 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 @@ Accounting / Payments + + + Payment Mode company rule 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 @@ - - Auction / Manager - Auction / User + + Auction / Manager + + - \ No newline at end of file + 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 @@ + name="current" help="Draft, Open and Pending Leads" + domain="[('state','in',('draft','open','pending'))]"/> 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 @@ + domain="[('state','in',('draft','open','pending'))]"/> 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 @@ form - + - + @@ -366,9 +366,9 @@ - + - + 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 @@ - - Sales / Manager - - - Sales / User + Sales / User - Own Leads Only - Sales / User - See All Leads + Sales / User - All Leads + + + + + Sales / Manager + 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 @@ - - Marketing / Manager - - Marketing / User + + Marketing / Manager + + + Sales / Manager 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 @@ res.users - + - + @@ -82,9 +82,9 @@ form - + - + 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 @@ - - Human Resources / Manager - - Human Resources / Officer + + Human Resources / Manager + + + 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 @@ - + - - Tools / Manager - - - Tools / User - + + Tools / User + + + Tools / Manager + + - + 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 @@ - - Tools / Manager - - - Tools / User - - + + Tools / User + + + Tools / Manager + + + 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 @@ Marketing / User - + Marketing / Manager + - + 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 @@ - - Manufacturing / Manager - Manufacturing / User + + Manufacturing / Manager + + 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 @@ pos.order form - [['date_order','>=',time.strftime('%Y-%m-%d')]] + [] Sales 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 @@ - - Point of Sale / Manager - Point of Sale / User + + Point of Sale / Manager + + + 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,10 +43,19 @@ the portal's users. - + + + + + + + + + + @@ -56,18 +65,6 @@ the portal's users.