diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index ddfdb05ca66..fff47205582 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -27,13 +27,15 @@ import time import tools from tools.translate import _ +from base.res.res_partner import format_address + CRM_LEAD_PENDING_STATES = ( crm.AVAILABLE_STATES[2][0], # Cancelled crm.AVAILABLE_STATES[3][0], # Done crm.AVAILABLE_STATES[4][0], # Pending ) -class crm_lead(base_stage, osv.osv): +class crm_lead(base_stage, format_address, osv.osv): """ CRM Lead Case """ _name = "crm.lead" _description = "Lead/Opportunity" @@ -105,6 +107,12 @@ class crm_lead(base_stage, osv.osv): return result, fold + def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): + res = super(crm_lead,self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu) + if view_type == 'form': + res['arch'] = self.fields_view_get_address(cr, user, res['arch'], context=context) + return res + _group_by_full = { 'stage_id': _read_group_stage_ids } diff --git a/addons/mail/res_users.py b/addons/mail/res_users.py index f9ca54c478d..8bbe075f159 100644 --- a/addons/mail/res_users.py +++ b/addons/mail/res_users.py @@ -72,6 +72,9 @@ class res_users(osv.Model): def create(self, cr, uid, data, context=None): # create default alias same as the login + if not data.get('login', False): + raise osv.except_osv(_('Invalid Action!'), _('You may not create a user.')) + mail_alias = self.pool.get('mail.alias') alias_id = mail_alias.create_unique_alias(cr, uid, {'alias_name': data['login']}, model_name=self._name, context=context) data['alias_id'] = alias_id diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index a2c45bead62..ee3aa942b7b 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -30,7 +30,7 @@ class sale_advance_payment_inv(osv.osv_memory): 'advance_payment_method':fields.selection( [('all', 'Invoice the whole sale order'), ('percentage','Percentage'), ('fixed','Fixed price (deposit)'), ('lines', 'Some order lines')], - 'Invoice Method', required=True, + 'What do you want to invoice?', required=True, help="""Use All to create the final invoice. Use Percentage to invoice a percentage of the total amount. Use Fixed Price to invoice a specific amound in advance.