[IMP] Improve portal wizard string
bzr revid: ara@tinyerp.com-20120604071051-mwr1o7vq72s0iewh
This commit is contained in:
parent
297ee5313a
commit
1e49be80c9
|
@ -158,12 +158,7 @@ class wizard(osv.osv_memory):
|
|||
existing_users = user_obj.browse(cr, ROOT_UID, existing_uids)
|
||||
existing_logins = [user.login for user in existing_users]
|
||||
new_users_data = []
|
||||
if u.has_portal_user==False:
|
||||
new_users_data = []
|
||||
if u.user_email in existing_logins:
|
||||
portal_uids = user_obj.search(cr, ROOT_UID, [('login','=',u.user_email),('partner_id', '=', u.partner_id.id)])
|
||||
user_obj.unlink(cr,uid,portal_uids)
|
||||
else:
|
||||
if u.has_portal_user:
|
||||
if u.user_email not in existing_logins:
|
||||
new_users_data.append({
|
||||
'name': u.name,
|
||||
|
@ -177,7 +172,11 @@ class wizard(osv.osv_memory):
|
|||
} )
|
||||
portal_obj.write(cr, ROOT_UID, [wiz.portal_id.id],
|
||||
{'users': [(0, 0, data) for data in new_users_data]}, context0)
|
||||
|
||||
else:
|
||||
new_users_data = []
|
||||
if u.user_email in existing_logins:
|
||||
portal_uids = user_obj.search(cr, ROOT_UID, [('login','=',u.user_email),('partner_id', '=', u.partner_id.id)])
|
||||
user_obj.unlink(cr,uid,portal_uids)
|
||||
# send email to all users (translated in their language)
|
||||
data = {
|
||||
'company': user.company_id.name,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<data>
|
||||
<!-- wizard action on res.partner -->
|
||||
<act_window id="partner_wizard_action"
|
||||
name="Add Portal Access"
|
||||
name="Portal Access Management Wizard"
|
||||
src_model="res.partner"
|
||||
res_model="res.portal.wizard"
|
||||
view_type="form" view_mode="form"
|
||||
|
@ -12,7 +12,7 @@
|
|||
|
||||
<!-- wizard view -->
|
||||
<record id="wizard_view" model="ir.ui.view">
|
||||
<field name="name">Add Portal Access</field>
|
||||
<field name="name">Portal Access Management Wizard</field>
|
||||
<field name="model">res.portal.wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
|
|
Loading…
Reference in New Issue