[MERGE] [IMP] User creation flow
Server-side branch: - res.users simplified form view: login field is called 'Email Address' to try to have email-style login (byt no constraint on the login currently; email and login are still different fields); - res.users form view: removed contact fields from the user view, but added a link to the partner. It allows to go from the user to the related partner and have access to all its profile data; - res.partner: email is necessary if user_ids is not empty (aka, partner is an user) bzr revid: tde@openerp.com-20130604154515-0msg7b57luox54sr
This commit is contained in:
@@ -472,7 +472,7 @@ class ir_mail_server(osv.osv):
|
||||
e.__class__.__name__,
|
||||
tools.ustr(e))
|
||||
_logger.exception(msg)
|
||||
raise MailDeliveryException(_("Mail delivery failed"), msg)
|
||||
raise MailDeliveryException(_("Mail Delivery Failed"), msg)
|
||||
return message_id
|
||||
|
||||
def on_change_encryption(self, cr, uid, ids, smtp_encryption):
|
||||
|
||||
@@ -111,7 +111,8 @@
|
||||
<group>
|
||||
<field name="category_id" widget="many2many_tags" placeholder="Tags..."/>
|
||||
<field name="function" placeholder="e.g. Sales Director"/>
|
||||
<field name="email" required="context.get('force_email', False)"/>
|
||||
<field name="user_ids" invisible="1"/>
|
||||
<field name="email" widget="email" required="context.get('force_email', False)" attrs="{'required': [('user_ids','!=', [])]}"/>
|
||||
<field name="phone"/>
|
||||
<field name="mobile"/>
|
||||
</group>
|
||||
@@ -178,7 +179,8 @@
|
||||
<field name="phone" placeholder="e.g. +32.81.81.37.00"/>
|
||||
<field name="mobile"/>
|
||||
<field name="fax"/>
|
||||
<field name="email" widget="email"/>
|
||||
<field name="user_ids" invisible="1"/>
|
||||
<field name="email" widget="email" attrs="{'required': [('user_ids','!=', [])]}"/>
|
||||
<field name="title" domain="[('domain', '=', 'contact')]"
|
||||
options='{"no_open": True}' attrs="{'invisible': [('is_company','=', True)]}" />
|
||||
</group>
|
||||
|
||||
@@ -165,6 +165,9 @@ class res_users(osv.osv):
|
||||
deprecated='Use the email field instead of user_email. This field will be removed with OpenERP 7.1.'),
|
||||
}
|
||||
|
||||
def on_change_login(self, cr, uid, ids, login, context=None):
|
||||
return {'value': {'email': login}}
|
||||
|
||||
def on_change_company_id(self, cr, uid, ids, company_id):
|
||||
return {'warning' : {
|
||||
'title': _("Company Switch Warning"),
|
||||
|
||||
@@ -100,8 +100,12 @@
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<h1><field name="name"/></h1>
|
||||
<label for="login" class="oe_edit_only"/>
|
||||
<h2><field name="login"/></h2>
|
||||
<field name="email" invisible="1"/>
|
||||
<label for="login" class="oe_edit_only" string="Email Address"/>
|
||||
<h2>
|
||||
<field name="login" on_change="on_change_login(login)"
|
||||
placeholder="email@yourcompany.com"/>
|
||||
</h2>
|
||||
<label for="company_id" class="oe_edit_only" groups="base.group_multi_company"/>
|
||||
<field name="company_id" context="{'user_preference': 0}" groups="base.group_multi_company"/>
|
||||
</div>
|
||||
@@ -112,9 +116,8 @@
|
||||
<field name="groups_id" readonly="1" widget="many2many_tags" style="display: inline;"/> You will be able to define additional access rights by editing the newly created user under the Settings / Users menu.
|
||||
</div>
|
||||
<field name="phone" placeholder="e.g. +32.81.81.37.00"/>
|
||||
<field name="mobile"/>
|
||||
<field name="fax"/>
|
||||
<field name="email" widget="email" required="True"/>
|
||||
<field name="mobile" placeholder="e.g. +32.479.19.28.37"/>
|
||||
<field name="fax" placeholder="e.g. +32.81.81.37.10"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
@@ -129,22 +132,25 @@
|
||||
<field name="id" invisible="1"/>
|
||||
<div class="oe_right oe_button_box">
|
||||
<button string="Change Password" type="action" name="%(change_password_wizard_action)d"
|
||||
help="Change the user password."/>
|
||||
class="oe_link" help="Change the user password."/>
|
||||
</div>
|
||||
<field name="image" widget='image' class="oe_avatar oe_left" options='{"preview_image": "image_medium"}'/>
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<h1><field name="name"/></h1>
|
||||
<label for="login" class="oe_edit_only"/>
|
||||
<h2><field name="login"/></h2>
|
||||
<field name="email" invisible="1"/>
|
||||
<label for="login" class="oe_edit_only" string="Email Address"/>
|
||||
<h2><field name="login" on_change="on_change_login(login)"/></h2>
|
||||
<label for="company_id" class="oe_edit_only" groups="base.group_multi_company"/>
|
||||
<field name="company_id" context="{'user_preference': 0}" groups="base.group_multi_company"/>
|
||||
<group>
|
||||
<field name="partner_id" readonly="1" required="0" groups="base.group_no_one"
|
||||
attrs="{'invisible': [('id', '=', False)]}"/>
|
||||
<field name="active"/>
|
||||
</group>
|
||||
</div>
|
||||
<notebook colspan="4">
|
||||
<page string="Access Rights">
|
||||
<group>
|
||||
<field name="active"/>
|
||||
</group>
|
||||
<group string="Allowed Companies" groups="base.group_multi_company">
|
||||
<field name="company_ids" nolabel="1" widget="many2many_tags"/>
|
||||
</group>
|
||||
@@ -152,14 +158,6 @@
|
||||
<field name="groups_id"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Contact">
|
||||
<group>
|
||||
<field name="phone" placeholder="e.g. +32.81.81.37.00"/>
|
||||
<field name="mobile"/>
|
||||
<field name="fax"/>
|
||||
<field name="email" widget="email"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Preferences">
|
||||
<group>
|
||||
<group name="preferences">
|
||||
@@ -244,7 +242,6 @@
|
||||
<field name="image" widget='image' class="oe_right oe_avatar" options='{"preview_image": "image_small"}'/>
|
||||
<h1>
|
||||
<field name="name" readonly="1" class="oe_inline"/>
|
||||
(<field name="login" readonly="1" class="oe_inline"/>)
|
||||
</h1>
|
||||
<button name="preference_change_password" type="object" string="Change password" class="oe_link"/>
|
||||
<group name="preferences" col="4">
|
||||
|
||||
Reference in New Issue
Block a user