[FIX] cleanup trailing whitespace
bzr revid: xmo@openerp.com-20101108142251-yye0ycby12o6sakf
This commit is contained in:
parent
9e1849f897
commit
ce0af9fc2a
|
@ -59,8 +59,8 @@ class account_installer(osv.osv_memory):
|
||||||
"country."),
|
"country."),
|
||||||
'date_start': fields.date('Start Date', required=True),
|
'date_start': fields.date('Start Date', required=True),
|
||||||
'date_stop': fields.date('End Date', required=True),
|
'date_stop': fields.date('End Date', required=True),
|
||||||
'period': fields.selection([('month', 'Monthly'), ('3months','3 Monthly')], 'Periods', required=True),
|
'period': fields.selection([('month', 'Monthly'), ('3months', '3 Monthly')], 'Periods', required=True),
|
||||||
'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Your Bank and Cash Accounts'),
|
'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Your Bank and Cash Accounts',required=True),
|
||||||
'sale_tax': fields.float('Sale Tax(%)'),
|
'sale_tax': fields.float('Sale Tax(%)'),
|
||||||
'purchase_tax': fields.float('Purchase Tax(%)'),
|
'purchase_tax': fields.float('Purchase Tax(%)'),
|
||||||
'company_id': fields.many2one('res.company', 'Company'),
|
'company_id': fields.many2one('res.company', 'Company'),
|
||||||
|
|
|
@ -26,7 +26,7 @@ from tools.translate import _
|
||||||
class crm_lead2opportunity(osv.osv_memory):
|
class crm_lead2opportunity(osv.osv_memory):
|
||||||
_name = 'crm.lead2opportunity'
|
_name = 'crm.lead2opportunity'
|
||||||
_description = 'Lead To Opportunity'
|
_description = 'Lead To Opportunity'
|
||||||
|
|
||||||
def action_cancel(self, cr, uid, ids, context=None):
|
def action_cancel(self, cr, uid, ids, context=None):
|
||||||
"""
|
"""
|
||||||
Closes Lead To Opportunity form
|
Closes Lead To Opportunity form
|
||||||
|
@ -38,7 +38,7 @@ class crm_lead2opportunity(osv.osv_memory):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return {'type': 'ir.actions.act_window_close'}
|
return {'type': 'ir.actions.act_window_close'}
|
||||||
|
|
||||||
def action_apply(self, cr, uid, ids, context=None):
|
def action_apply(self, cr, uid, ids, context=None):
|
||||||
"""
|
"""
|
||||||
This converts lead to opportunity and opens Opportunity view
|
This converts lead to opportunity and opens Opportunity view
|
||||||
|
@ -71,11 +71,11 @@ class crm_lead2opportunity(osv.osv_memory):
|
||||||
|
|
||||||
for this in self.browse(cr, uid, ids, context=context):
|
for this in self.browse(cr, uid, ids, context=context):
|
||||||
vals ={
|
vals ={
|
||||||
'planned_revenue': this.planned_revenue,
|
'planned_revenue': this.planned_revenue,
|
||||||
'probability': this.probability,
|
'probability': this.probability,
|
||||||
'name': this.name,
|
'name': this.name,
|
||||||
'partner_id': this.partner_id.id,
|
'partner_id': this.partner_id.id,
|
||||||
'user_id': (this.partner_id.user_id and this.partner_id.user_id.id) or (lead.user_id and lead.user_id.id),
|
'user_id': (this.partner_id.user_id and this.partner_id.user_id.id) or (lead.user_id and lead.user_id.id),
|
||||||
'type': 'opportunity'
|
'type': 'opportunity'
|
||||||
}
|
}
|
||||||
lead_obj.write(cr, uid, lead.id, vals, context=context)
|
lead_obj.write(cr, uid, lead.id, vals, context=context)
|
||||||
|
@ -86,26 +86,26 @@ class crm_lead2opportunity(osv.osv_memory):
|
||||||
message = _('Lead ') + " '" + lead.name + "' "+ _("is converted to Opportunity.")
|
message = _('Lead ') + " '" + lead.name + "' "+ _("is converted to Opportunity.")
|
||||||
self.log(cr, uid, lead.id, message)
|
self.log(cr, uid, lead.id, message)
|
||||||
value = {
|
value = {
|
||||||
'name': _('Opportunity'),
|
'name': _('Opportunity'),
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
'view_mode': 'form,tree',
|
'view_mode': 'form,tree',
|
||||||
'res_model': 'crm.lead',
|
'res_model': 'crm.lead',
|
||||||
'domain': [('type', '=', 'opportunity')],
|
'domain': [('type', '=', 'opportunity')],
|
||||||
'res_id': int(lead.id),
|
'res_id': int(lead.id),
|
||||||
'view_id': False,
|
'view_id': False,
|
||||||
'views': [(id2, 'form'), (id3, 'tree'), (False, 'calendar'), (False, 'graph')],
|
'views': [(id2, 'form'), (id3, 'tree'), (False, 'calendar'), (False, 'graph')],
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
'search_view_id': res['res_id']
|
'search_view_id': res['res_id']
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'name' : fields.char('Opportunity', size=64, required=True, select=1),
|
'name' : fields.char('Opportunity', size=64, required=True, select=1),
|
||||||
'probability': fields.float('Success Rate (%)'),
|
'probability': fields.float('Success Rate (%)'),
|
||||||
'planned_revenue': fields.float('Expected Revenue'),
|
'planned_revenue': fields.float('Expected Revenue'),
|
||||||
'partner_id': fields.many2one('res.partner', 'Partner'),
|
'partner_id': fields.many2one('res.partner', 'Partner'),
|
||||||
}
|
}
|
||||||
|
|
||||||
def view_init(self, cr, uid, fields, context=None):
|
def view_init(self, cr, uid, fields, context=None):
|
||||||
"""
|
"""
|
||||||
This function checks for precondition before wizard executes
|
This function checks for precondition before wizard executes
|
||||||
|
@ -154,8 +154,8 @@ class crm_lead2opportunity_partner(osv.osv_memory):
|
||||||
_inherit = 'crm.lead2partner'
|
_inherit = 'crm.lead2partner'
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'partner_id': fields.many2one('res.partner', 'Partner'),
|
'partner_id': fields.many2one('res.partner', 'Partner'),
|
||||||
'action': fields.selection([('exist', 'Link to an existing partner'), ('create', 'Create a new partner'), ('no','Do not create a partner')], 'Action'),
|
'action': fields.selection([('exist', 'Link to an existing partner'), ('create', 'Create a new partner'), ('no','Do not create a partner')], 'Action'),
|
||||||
}
|
}
|
||||||
|
|
||||||
def make_partner(self, cr, uid, ids, context=None):
|
def make_partner(self, cr, uid, ids, context=None):
|
||||||
|
@ -171,7 +171,7 @@ class crm_lead2opportunity_partner(osv.osv_memory):
|
||||||
"""
|
"""
|
||||||
if not context:
|
if not context:
|
||||||
context = {}
|
context = {}
|
||||||
|
|
||||||
partner_ids = self._create_partner(cr, uid, ids, context)
|
partner_ids = self._create_partner(cr, uid, ids, context)
|
||||||
value = {}
|
value = {}
|
||||||
data_obj = self.pool.get('ir.model.data')
|
data_obj = self.pool.get('ir.model.data')
|
||||||
|
@ -179,18 +179,18 @@ class crm_lead2opportunity_partner(osv.osv_memory):
|
||||||
view_id = False
|
view_id = False
|
||||||
if data_id:
|
if data_id:
|
||||||
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
||||||
|
|
||||||
context.update({'partner_id': partner_ids})
|
context.update({'partner_id': partner_ids})
|
||||||
value = {
|
value = {
|
||||||
'name': _('Create Opportunity'),
|
'name': _('Create Opportunity'),
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
'view_mode': 'form,tree',
|
'view_mode': 'form,tree',
|
||||||
'res_model': 'crm.lead2opportunity.action',
|
'res_model': 'crm.lead2opportunity.action',
|
||||||
'view_id': False,
|
'view_id': False,
|
||||||
'context': context,
|
'context': context,
|
||||||
'views': [(view_id, 'form')],
|
'views': [(view_id, 'form')],
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
'target': 'new',
|
'target': 'new',
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
@ -213,19 +213,19 @@ class crm_lead2opportunity_partner(osv.osv_memory):
|
||||||
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
||||||
|
|
||||||
context.update({'partner_id': False})
|
context.update({'partner_id': False})
|
||||||
value = {
|
value = {
|
||||||
'name': _('Create Opportunity'),
|
'name': _('Create Opportunity'),
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
'view_mode': 'form,tree',
|
'view_mode': 'form,tree',
|
||||||
'res_model': 'crm.lead2opportunity',
|
'res_model': 'crm.lead2opportunity',
|
||||||
'view_id': False,
|
'view_id': False,
|
||||||
'context': context,
|
'context': context,
|
||||||
'views': [(view_id, 'form')],
|
'views': [(view_id, 'form')],
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
'target': 'new',
|
'target': 'new',
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
def view_init(self, cr, uid, fields, context=None):
|
def view_init(self, cr, uid, fields, context=None):
|
||||||
"""
|
"""
|
||||||
|
@ -278,30 +278,30 @@ class crm_lead2opportunity_action(osv.osv_memory):
|
||||||
if data_id:
|
if data_id:
|
||||||
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
||||||
value = {
|
value = {
|
||||||
'name': _('Create Opportunity'),
|
'name': _('Create Opportunity'),
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
'view_mode': 'form,tree',
|
'view_mode': 'form,tree',
|
||||||
'res_model': 'crm.lead2opportunity',
|
'res_model': 'crm.lead2opportunity',
|
||||||
'view_id': False,
|
'view_id': False,
|
||||||
'context': context,
|
'context': context,
|
||||||
'views': [(view_id, 'form')],
|
'views': [(view_id, 'form')],
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
'target': 'new',
|
'target': 'new',
|
||||||
}
|
}
|
||||||
elif this.name == 'merge':
|
elif this.name == 'merge':
|
||||||
data_id = data_obj._get_id(cr, uid, 'crm', 'merge_opportunity_form')
|
data_id = data_obj._get_id(cr, uid, 'crm', 'merge_opportunity_form')
|
||||||
if data_id:
|
if data_id:
|
||||||
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
||||||
value = {
|
value = {
|
||||||
'name': _('Merge with Existing Opportunity'),
|
'name': _('Merge with Existing Opportunity'),
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
'view_mode': 'form,tree',
|
'view_mode': 'form,tree',
|
||||||
'res_model': 'crm.merge.opportunity',
|
'res_model': 'crm.merge.opportunity',
|
||||||
'view_id': False,
|
'view_id': False,
|
||||||
'context': context,
|
'context': context,
|
||||||
'views': [(view_id, 'form')],
|
'views': [(view_id, 'form')],
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
'target': 'new',
|
'target': 'new',
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue