RavishchandraMurari(OpenERP) has proposed merging
lp:~openerp-dev/openobject-server/trunk-usability-remove_address_id_email-rmu
into lp:openobject-server.
Requested reviews:
Amit (Open ERP) (apa-tiny)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-usability-remove_address_id_email-rmu/+merge/65329
hello sir
I have correct all require changes.
Thanks
Ravish
--
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-usability-remove_address_id_email-rmu/+merge/65329
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-server/trunk-usability-remove_address_id_email-rmu.
=== modified file 'openerp/addons/base/base_update.xml'
--- openerp/addons/base/base_update.xml 2011-01-06 17:38:28 +0000
+++ openerp/addons/base/base_update.xml 2011-06-21 10:41:47 +0000
@@ -119,7 +119,7 @@
context="{'user_preference': 0}"
groups="base.group_multi_company"
/>
- <field name="address_id"/>
+ <!--field name="address_id"/-->
<field name="user_email" widget="email"/>
</group>
<group colspan="1" col="2" groups="base.group_extended">
@@ -175,7 +175,7 @@
<search string="Users">
<field name="name"/>
<field name="login"/>
- <field name="address_id" string="Address"/>
+ <!--field name="address_id" string="Address"/-->
<field name="company_ids" string="Company" groups="base.group_multi_company"/>
</search>
</field>
@@ -255,7 +255,7 @@
</xpath>
<group string="res_config_contents" position="replace">
<field name="name"/>
- <field name="email"/>
+ <field name="user_email"/>
<field name="login"/>
<field name="password" password="True"/>
<field name="context_lang"/>
=== modified file 'openerp/addons/base/res/partner/partner_view.xml'
--- openerp/addons/base/res/partner/partner_view.xml 2011-04-28 16:04:34 +0000
+++ openerp/addons/base/res/partner/partner_view.xml 2011-06-21 10:41:47 +0000
@@ -125,7 +125,7 @@
<field name="act_window_id" ref="action_partner_address_form"/>
</record>
<menuitem action="action_partner_address_form" id="menu_partner_address_form"
- groups="base.group_extended"
+ groups="base.group_extended" name="Contacts"
parent="base.menu_address_book" sequence="30"/>
<!--
=== modified file 'openerp/addons/base/res/res_user.py'
--- openerp/addons/base/res/res_user.py 2011-05-23 11:19:53 +0000
+++ openerp/addons/base/res/res_user.py 2011-06-21 10:41:47 +0000
@@ -38,7 +38,7 @@
'name': fields.char('Group Name', size=64, required=True),
'model_access': fields.one2many('ir.model.access', 'group_id', 'Access Controls'),
'rule_groups': fields.many2many('ir.rule', 'rule_group_rel',
- 'group_id', 'rule_group_id', 'Rules', domain=[('global', '=', False)]),
+ 'group_id', 'rule_group_id', 'Rules', domain=[('global', '=', False)]),
'menu_access': fields.many2many('ir.ui.menu', 'ir_ui_menu_group_rel', 'gid', 'menu_id', 'Access Menu'),
'comment' : fields.text('Comment',size=250),
}
@@ -138,6 +138,11 @@
_('"email_from" needs to be set to send welcome mails '
'to users'))
return False
+<<<<<<< TREE
+=======
+ if not user.get('user_email'):
+ return False
+>>>>>>> MERGE-SOURCE
return tools.email_send(email_from=None, email_to=[user['email']],
subject=self.get_welcome_mail_subject(
@@ -175,24 +180,7 @@
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:
@@ -220,14 +208,13 @@
fnct_inv=_set_new_password,
string='Change password', help="Only specify a value if you want to change the user password. "
"This user will have to logout and login again!"),
- 'email': fields.char('E-mail', size=64,
+ 'user_email': fields.char('E-mail', size=64,
help='If an email is provided, the user will be sent a message '
'welcoming him.\n\nWarning: if "email_from" and "smtp_server"'
" aren't configured, it won't be possible to email new "
"users."),
'signature': fields.text('Signature', size=64),
- 'address_id': fields.many2one('res.partner.address', 'Address'),
- 'active': fields.boolean('Active'),
+ 'active': fields.boolean('Active'),
'action_id': fields.many2one('ir.actions.actions', 'Home Action', help="If specified, this action will be opened at logon for this user, in addition to the standard menu."),
'menu_id': fields.many2one('ir.actions.actions', 'Menu Action', help="If specified, the action will replace the standard menu for this user."),
'groups_id': fields.many2many('res.groups', 'res_groups_users_rel', 'uid', 'gid', 'Groups'),
@@ -248,8 +235,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),
- 'menu_tips': fields.boolean('Menu Tips', help="Check out this box if you want to always display tips on each menu action"),
+ '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),
}
@@ -347,7 +333,6 @@
'company_id': _get_company,
'company_ids': _get_companies,
'groups_id': _get_group,
- 'address_id': False,
'menu_tips':True
}
@@ -531,6 +516,7 @@
with the user's data %-formatted into the mail body
"""
base_data = self.read(cr, uid, new_id, context=context)
+<<<<<<< TREE
partner_id = self.pool.get('res.partner').main_partner(cr, uid)
address = self.pool.get('res.partner.address').create(
cr, uid, {'name': base_data['name'],
@@ -546,6 +532,13 @@
'address_id' : address,
'groups_id' : [(6,0, base_data.get('groups_id',[]))],
})
+=======
+ user_data = dict(
+ base_data,
+ signature=self._generate_signature(
+ cr, base_data['name'], base_data['email'], context=context)
+ )
+>>>>>>> MERGE-SOURCE
new_user = self.pool.get('res.users').create(
cr, uid, base_data, context)
self.send_welcome_email(cr, uid, new_user, context=context)
_______________________________________________
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