diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py index 8ad956510eb..aa6a9cf96c6 100644 --- a/addons/portal/wizard/portal_wizard.py +++ b/addons/portal/wizard/portal_wizard.py @@ -123,10 +123,18 @@ class wizard_user(osv.osv_memory): _columns = { 'wizard_id': fields.many2one('portal.wizard', string='Wizard', required=True), 'partner_id': fields.many2one('res.partner', string='Contact', required=True, readonly=True), - 'email': fields.related('partner_id', 'email', type='char', string='Email'), + 'email': fields.char(size=240, string='Email'), 'in_portal': fields.boolean('In Portal'), } + def create(self, cr, uid, values, context=None): + """ overridden to update the partner's email (if necessary) """ + id = super(wizard_user, self).create(cr, uid, values, context) + wuser = self.browse(cr, uid, id, context) + if wuser.partner_id.email != wuser.email: + wuser.partner_id.write({'email': wuser.email}) + return id + def action_apply(self, cr, uid, ids, context=None): res_users = self.pool.get('res.users') for wizard_user in self.browse(cr, SUPERUSER_ID, ids, context): diff --git a/addons/portal/wizard/portal_wizard_view.xml b/addons/portal/wizard/portal_wizard_view.xml index 6c31a3da371..b2686b34c27 100644 --- a/addons/portal/wizard/portal_wizard_view.xml +++ b/addons/portal/wizard/portal_wizard_view.xml @@ -19,7 +19,11 @@ -