From 73750e33b943cb6167268bfff49116d0f7234176 Mon Sep 17 00:00:00 2001 From: "vta vta@openerp.com" <> Date: Tue, 20 Nov 2012 08:39:48 +0100 Subject: [PATCH] [FIX] Removed password from sent email. Fixed naming in order to pass runbot's test. bzr revid: vta@openerp.com-20121120073948-1ojettqx7mjb1k75 --- addons/portal/wizard/portal_wizard.py | 6 ------ addons/portal_crm/contact.py | 6 +++--- addons/portal_crm/contact_view.xml | 14 +++++++------- addons/portal_crm/test/contact_form.yml | 4 ++-- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py index 545b771e762..485aa941434 100644 --- a/addons/portal/wizard/portal_wizard.py +++ b/addons/portal/wizard/portal_wizard.py @@ -39,7 +39,6 @@ You have been given access to %(portal)s. Your login account data is: Database: %(db)s Username: %(login)s -Password: %(password)s In order to complete the signin process, click on the following url: %(url)s @@ -51,10 +50,6 @@ OpenERP - Open Source Business Applications http://www.openerp.com """) -def random_password(): - # temporary random stuff; user password is reset by signup process - chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' - return ''.join(random.choice(chars) for i in xrange(12)) def extract_email(email): """ extract the email address from a user-friendly email address """ @@ -181,7 +176,6 @@ class wizard_user(osv.osv_memory): create_context = dict(context or {}, noshortcut=True) # to prevent shortcut creation values = { 'login': extract_email(wizard_user.email), - 'password': random_password(), 'partner_id': wizard_user.partner_id.id, 'groups_id': [(6, 0, [])], 'share': True, diff --git a/addons/portal_crm/contact.py b/addons/portal_crm/contact.py index 3beed3b3282..c4d4e1d7f8c 100644 --- a/addons/portal_crm/contact.py +++ b/addons/portal_crm/contact.py @@ -22,9 +22,9 @@ from openerp.osv import osv, fields from openerp import SUPERUSER_ID -class contact(osv.TransientModel): +class crm_contact_us(osv.TransientModel): """ Create new leads through the "contact us" form """ - _name = 'contact' + _name = 'portal_crm.crm_contact_us' _description = 'Contact form for the portal' _inherit = 'crm.lead' _columns = { @@ -104,7 +104,7 @@ class contact(osv.TransientModel): Since the 'name' field is mandatory, give an empty string to avoid an integrity error. """ empty_values = dict((k, False) if k != 'name' else (k, '') for k, v in values.iteritems()) - return super(contact, self).create(cr, uid, empty_values) + return super(crm_contact_us, self).create(cr, uid, empty_values) def submit(self, cr, uid, ids, context=None): """ When the form is submitted, redirect the user to a "Thanks" message """ diff --git a/addons/portal_crm/contact_view.xml b/addons/portal_crm/contact_view.xml index 25216d9ff29..0241259a82a 100644 --- a/addons/portal_crm/contact_view.xml +++ b/addons/portal_crm/contact_view.xml @@ -4,7 +4,7 @@ Contact form - contact + portal_crm.crm_contact_us
@@ -12,12 +12,11 @@ - - - + + + -