Rifakat (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-server/6.0-opw-39153-rha into 
lp:openobject-server/6.0.

Requested reviews:
  nel (nel-tinyerp)
Related bugs:
  Bug #889124 in OpenERP Server: "[V6] Email in preference change company 
partner email"
  https://bugs.launchpad.net/openobject-server/+bug/889124

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-opw-39153-rha/+merge/82115

Hello,

I have changed type of field user_email of res.users from function field to 
char. While changing user's email from menu User > Preferences > Preferences, 
email of user related company's partner(address) email was also changed, and 
vice versa.

Now if we change user email from preferences then it will change related user's 
email only.

Kindly review it.

Regards,
Rifakat.
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-opw-39153-rha/+merge/82115
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-server/6.0-opw-39153-rha.
=== modified file 'bin/addons/base/res/res_user.py'
--- bin/addons/base/res/res_user.py	2011-05-09 10:24:54 +0000
+++ bin/addons/base/res/res_user.py	2011-11-14 10:12:39 +0000
@@ -175,25 +175,6 @@
         extended_users = group_obj.read(cr, uid, extended_group_id, ['users'], context=context)['users']
         return dict(zip(ids, ['extended' if user in extended_users else 'simple' for user in ids]))
 
-    def _email_get(self, cr, uid, ids, name, arg, context=None):
-        # perform this as superuser because the current user is allowed to read users, and that includes
-        # the email, even without any direct read access on the res_partner_address object.
-        return dict([(user.id, user.address_id.email) for user in self.browse(cr, 1, ids)]) # no context to avoid potential security issues as superuser
-
-    def _email_set(self, cr, uid, ids, name, value, arg, context=None):
-        if not isinstance(ids,list):
-            ids = [ids]
-        address_obj = self.pool.get('res.partner.address')
-        for user in self.browse(cr, uid, ids, context=context):
-            # perform this as superuser because the current user is allowed to write to the user, and that includes
-            # the email even without any direct write access on the res_partner_address object.
-            if user.address_id:
-                address_obj.write(cr, 1, user.address_id.id, {'email': value or None}) # no context to avoid potential security issues as superuser
-            else:
-                address_id = address_obj.create(cr, 1, {'name': user.name, 'email': value or None}) # no context to avoid potential security issues as superuser
-                self.write(cr, uid, ids, {'address_id': address_id}, context)
-        return True
-
     def _set_new_password(self, cr, uid, id, name, value, args, context=None):
         if value is False:
             # Do not update the password if no value is provided, ignore silently.
@@ -245,7 +226,7 @@
         'view': fields.function(_get_interface_type, method=True, type='selection', fnct_inv=_set_interface_type,
                                 selection=[('simple','Simplified'),('extended','Extended')],
                                 string='Interface', help="Choose between the simplified interface and the extended one"),
-        'user_email': fields.function(_email_get, method=True, fnct_inv=_email_set, string='Email', type="char", size=240),
+        'user_email': fields.char('Email', size=64),
         'menu_tips': fields.boolean('Menu Tips', help="Check out this box if you want to always display tips on each menu action"),
         'date': fields.datetime('Last Connection', readonly=True),
     }

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to