diff --git a/addons/account/account.py b/addons/account/account.py
index 1a44e480e03..a620c0b5ddc 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -3401,7 +3401,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
try:
tmp2 = obj_data.get_object_reference(cr, uid, *ref)
if tmp2:
- self.pool.get(tmp2[0]).write(cr, uid, tmp2[1], {
+ self.pool[tmp2[0]].write(cr, uid, tmp2[1], {
'currency_id': obj_wizard.currency_id.id
})
except ValueError, e:
diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 222a0bebbb4..8fe79d87064 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -313,7 +313,7 @@ class account_invoice(osv.osv):
context = {}
if context.get('active_model', '') in ['res.partner'] and context.get('active_ids', False) and context['active_ids']:
- partner = self.pool.get(context['active_model']).read(cr, uid, context['active_ids'], ['supplier','customer'])[0]
+ partner = self.pool[context['active_model']].read(cr, uid, context['active_ids'], ['supplier','customer'])[0]
if not view_type:
view_id = self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'account.invoice.tree')])
view_type = 'tree'
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 8c0854bd6c6..c2f21c0d8bc 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -453,10 +453,11 @@
-
+
+
diff --git a/addons/account/wizard/pos_box.py b/addons/account/wizard/pos_box.py
index 49178dfd3ea..810d101eefd 100644
--- a/addons/account/wizard/pos_box.py
+++ b/addons/account/wizard/pos_box.py
@@ -21,7 +21,7 @@ class CashBox(osv.osv_memory):
active_model = context.get('active_model', False) or False
active_ids = context.get('active_ids', []) or []
- records = self.pool.get(active_model).browse(cr, uid, active_ids, context=context)
+ records = self.pool[active_model].browse(cr, uid, active_ids, context=context)
return self._run(cr, uid, ids, records, context=None)
diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
index 6f670b2c6b9..97a4bb8fac2 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml
+++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
@@ -267,7 +267,7 @@
-
+
diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py
index 5834db99cd3..40a227d8ceb 100644
--- a/addons/account_analytic_plans/account_analytic_plans.py
+++ b/addons/account_analytic_plans/account_analytic_plans.py
@@ -40,10 +40,10 @@ class one2many_mod2(fields.one2many):
plan = journal.plan_id
if plan and len(plan.plan_ids) > pnum:
acc_id = plan.plan_ids[pnum].root_analytic_id.id
- ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id,'in',ids),('analytic_account_id','child_of',[acc_id])], limit=self._limit)
+ ids2 = obj.pool[self._obj].search(cr, user, [(self._fields_id,'in',ids),('analytic_account_id','child_of',[acc_id])], limit=self._limit)
if ids2 is None:
- ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id,'in',ids)], limit=self._limit)
- for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
+ ids2 = obj.pool[self._obj].search(cr, user, [(self._fields_id,'in',ids)], limit=self._limit)
+ for r in obj.pool[self._obj]._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
res[r[self._fields_id]].append( r['id'] )
return res
diff --git a/addons/account_payment/report/order.rml b/addons/account_payment/report/order.rml
index ca2315d81b1..07d549db618 100644
--- a/addons/account_payment/report/order.rml
+++ b/addons/account_payment/report/order.rml
@@ -253,7 +253,7 @@
[[ get_invoice_name(line.ml_inv_ref.id) or '-' ]]
- [[line.date=='False' and '-' or formatLang(line.date,date=True) ]]
+ [[not line.date and '-' or formatLang(line.date,date=True) ]]
[[ formatLang(line.amount or '-', currency_obj=line.company_currency) ]]
diff --git a/addons/anonymization/anonymization.py b/addons/anonymization/anonymization.py
index de46e2e8d03..025f1f79f70 100644
--- a/addons/anonymization/anonymization.py
+++ b/addons/anonymization/anonymization.py
@@ -411,7 +411,7 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory):
model_name = field.model_id.model
field_name = field.field_id.name
field_type = field.field_id.ttype
- table_name = self.pool.get(model_name)._table
+ table_name = self.pool[model_name]._table
# get the current value
sql = "select id, %s from %s" % (field_name, table_name)
@@ -543,7 +543,7 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory):
fixes = group(fixes, ('model_name', 'field_name'))
for line in data:
- table_name = self.pool.get(line['model_id'])._table if self.pool.get(line['model_id']) else None
+ table_name = self.pool[line['model_id']]._table if line['model_id'] in self.pool else None
# check if custom sql exists:
key = (line['model_id'], line['field_id'])
diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py
index 811c5387697..159baf3a9e7 100644
--- a/addons/audittrail/audittrail.py
+++ b/addons/audittrail/audittrail.py
@@ -70,8 +70,7 @@ class audittrail_rule(osv.osv):
obj_model = self.pool.get('ir.model.data')
#start Loop
for thisrule in self.browse(cr, uid, ids):
- obj = self.pool.get(thisrule.object_id.model)
- if not obj:
+ if thisrule.object_id.model not in self.pool:
raise osv.except_osv(
_('WARNING: audittrail is not part of the pool'),
_('Change audittrail depends -- Setting rule as DRAFT'))
@@ -131,7 +130,7 @@ class audittrail_log(osv.osv):
model_object = resname.object_id
res_id = resname.res_id
if model_object and res_id:
- model_pool = self.pool.get(model_object.model)
+ model_pool = self.pool[model_object.model]
res = model_pool.read(cr, uid, res_id, ['name'])
data[resname.id] = res['name']
else:
@@ -190,7 +189,7 @@ def get_value_text(cr, uid, pool, resource_pool, method, field, value):
field_obj = (resource_pool._all_columns.get(field)).column
if field_obj._type in ('one2many','many2many'):
- data = pool.get(field_obj._obj).name_get(cr, uid, value)
+ data = pool[field_obj._obj].name_get(cr, uid, value)
#return the modifications on x2many fields as a list of names
res = map(lambda x:x[1], data)
elif field_obj._type == 'many2one':
@@ -212,7 +211,7 @@ def create_log_line(cr, uid, log_id, model, lines=None):
if lines is None:
lines = []
pool = openerp.registry(cr.dbname)
- obj_pool = pool.get(model.model)
+ obj_pool = pool[model.model]
model_pool = pool.get('ir.model')
field_pool = pool.get('ir.model.fields')
log_line_pool = pool.get('audittrail.log.line')
@@ -251,7 +250,7 @@ def log_fct(cr, uid_orig, model, method, fct_src, *args, **kw):
@return: Returns result as per method of Object proxy
"""
pool = openerp.registry(cr.dbname)
- resource_pool = pool.get(model)
+ resource_pool = pool[model]
model_pool = pool.get('ir.model')
model_ids = model_pool.search(cr, SUPERUSER_ID, [('model', '=', model)])
model_id = model_ids and model_ids[0] or False
@@ -321,7 +320,7 @@ def get_data(cr, uid, pool, res_ids, model, method):
}
"""
data = {}
- resource_pool = pool.get(model.model)
+ resource_pool = pool[model.model]
# read all the fields of the given resources in super admin mode
for resource in resource_pool.read(cr, SUPERUSER_ID, res_ids):
values = {}
@@ -390,7 +389,7 @@ def prepare_audittrail_log_line(cr, uid, pool, model, resource_id, method, old_v
key: []
}
# loop on all the fields
- for field_name, field_definition in pool.get(model.model)._all_columns.items():
+ for field_name, field_definition in pool[model.model]._all_columns.items():
if field_name in ('__last_update', 'id'):
continue
#if the field_list param is given, skip all the fields not in that list
@@ -457,7 +456,7 @@ def process_data(cr, uid, pool, res_ids, model, method, old_values=None, new_val
# if at least one modification has been found
for model_id, resource_id in lines:
- name = pool.get(model.model).name_get(cr, uid, [resource_id])[0][1]
+ name = pool[model.model].name_get(cr, uid, [resource_id])[0][1]
vals = {
'method': method,
'object_id': model_id,
diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py
index 62c808ed556..9d7d4d34ac4 100644
--- a/addons/base_action_rule/base_action_rule.py
+++ b/addons/base_action_rule/base_action_rule.py
@@ -96,7 +96,7 @@ class base_action_rule(osv.osv):
""" filter the list record_ids that satisfy the action filter """
if record_ids and action_filter:
assert action.model == action_filter.model_id, "Filter model different from action rule model"
- model = self.pool.get(action_filter.model_id)
+ model = self.pool[action_filter.model_id]
domain = [('id', 'in', record_ids)] + eval(action_filter.domain)
ctx = dict(context or {})
ctx.update(eval(action_filter.context))
@@ -106,7 +106,7 @@ class base_action_rule(osv.osv):
def _process(self, cr, uid, action, record_ids, context=None):
""" process the given action on the records """
# execute server actions
- model = self.pool.get(action.model_id.model)
+ model = self.pool[action.model_id.model]
if action.server_action_ids:
server_action_ids = map(int, action.server_action_ids)
for record in model.browse(cr, uid, record_ids, context):
@@ -195,7 +195,7 @@ class base_action_rule(osv.osv):
ids = self.search(cr, SUPERUSER_ID, [])
for action_rule in self.browse(cr, SUPERUSER_ID, ids):
model = action_rule.model_id.model
- model_obj = self.pool.get(model)
+ model_obj = self.pool[model]
if not hasattr(model_obj, 'base_action_ruled'):
model_obj.create = self._wrap_create(model_obj.create, model)
model_obj.write = self._wrap_write(model_obj.write, model)
@@ -232,7 +232,7 @@ class base_action_rule(osv.osv):
last_run = get_datetime(action.last_run) if action.last_run else False
# retrieve all the records that satisfy the action's condition
- model = self.pool.get(action.model_id.model)
+ model = self.pool[action.model_id.model]
domain = []
ctx = dict(context)
if action.filter_id:
diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py
index ca75c9e20fc..fe5ffbc8988 100644
--- a/addons/base_calendar/base_calendar.py
+++ b/addons/base_calendar/base_calendar.py
@@ -591,7 +591,7 @@ property or property parameter."),
for vals in self.browse(cr, uid, ids, context=context):
if vals.ref and vals.ref.user_id:
- mod_obj = self.pool.get(vals.ref._name)
+ mod_obj = self.pool[vals.ref._name]
res=mod_obj.read(cr,uid,[vals.ref.id],['duration','class'],context)
defaults = {'user_id': vals.user_id.id, 'organizer_id': vals.ref.user_id.id,'duration':res[0]['duration'],'class':res[0]['class']}
mod_obj.copy(cr, uid, vals.ref.id, default=defaults, context=context)
@@ -684,7 +684,7 @@ true, it will allow you to hide the event alarm information without removing it.
ir_obj = self.pool.get('ir.model')
model_id = ir_obj.search(cr, uid, [('model', '=', model)])[0]
- model_obj = self.pool.get(model)
+ model_obj = self.pool[model]
for data in model_obj.browse(cr, uid, ids, context=context):
basic_alarm = data.alarm_id
@@ -754,7 +754,7 @@ true, it will allow you to hide the event alarm information without removing it.
alarm_obj = self.pool.get('calendar.alarm')
ir_obj = self.pool.get('ir.model')
model_id = ir_obj.search(cr, uid, [('model', '=', model)])[0]
- model_obj = self.pool.get(model)
+ model_obj = self.pool[model]
for data in model_obj.browse(cr, uid, ids, context=context):
alarm_ids = alarm_obj.search(cr, uid, [('model_id', '=', model_id), ('res_id', '=', data.id)])
if alarm_ids:
@@ -853,7 +853,7 @@ class calendar_alarm(osv.osv):
for alarm in self.browse(cr, uid, alarm_ids, context=context):
next_trigger_date = None
update_vals = {}
- model_obj = self.pool.get(alarm.model_id.model)
+ model_obj = self.pool[alarm.model_id.model]
res_obj = model_obj.browse(cr, uid, alarm.res_id, context=context)
re_dates = []
diff --git a/addons/base_calendar/crm_meeting.py b/addons/base_calendar/crm_meeting.py
index 6010f5ccfca..aa476002abc 100644
--- a/addons/base_calendar/crm_meeting.py
+++ b/addons/base_calendar/crm_meeting.py
@@ -135,7 +135,7 @@ class mail_message(osv.osv):
def _find_allowed_model_wise(self, cr, uid, doc_model, doc_dict, context=None):
if doc_model == 'crm.meeting':
- for virtual_id in self.pool.get(doc_model).get_recurrent_ids(cr, uid, doc_dict.keys(), [], context=context):
+ for virtual_id in self.pool[doc_model].get_recurrent_ids(cr, uid, doc_dict.keys(), [], context=context):
doc_dict.setdefault(virtual_id, doc_dict[get_real_ids(virtual_id)])
return super(mail_message, self)._find_allowed_model_wise(cr, uid, doc_model, doc_dict, context=context)
diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py
index 64bad21ede1..072624a7d98 100644
--- a/addons/crm/__openerp__.py
+++ b/addons/crm/__openerp__.py
@@ -81,6 +81,8 @@ Dashboard for CRM will include:
'crm_lead_view.xml',
'crm_lead_menu.xml',
+ 'crm_case_section_view.xml',
+
'crm_meeting_menu.xml',
'crm_phonecall_view.xml',
@@ -114,9 +116,26 @@ Dashboard for CRM will include:
'test/crm_lead_copy.yml',
'test/crm_lead_unlink.yml',
],
+ 'css': [
+ 'static/src/css/crm.css'
+ ],
+ 'js': [
+ 'static/src/js/crm.js'
+ ],
'installable': True,
'application': True,
'auto_install': False,
- 'images': ['images/crm_dashboard.png', 'images/customers.png','images/leads.png','images/opportunities_kanban.png','images/opportunities_form.png','images/opportunities_calendar.png','images/opportunities_graph.png','images/logged_calls.png','images/scheduled_calls.png','images/stages.png'],
+ 'images': [
+ 'images/crm_dashboard.png',
+ 'images/customers.png',
+ 'images/leads.png',
+ 'images/opportunities_kanban.png',
+ 'images/opportunities_form.png',
+ 'images/opportunities_calendar.png',
+ 'images/opportunities_graph.png',
+ 'images/logged_calls.png',
+ 'images/scheduled_calls.png',
+ 'images/stages.png',
+ ],
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index df6d5e12b66..7b6fe02afa8 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -98,6 +98,7 @@ class crm_case_stage(osv.osv):
'case_default': True,
}
+
class crm_case_section(osv.osv):
""" Model for sales teams. """
_name = "crm.case.section"
@@ -107,7 +108,7 @@ class crm_case_section(osv.osv):
_order = "complete_name"
def get_full_name(self, cr, uid, ids, field_name, arg, context=None):
- return dict(self.name_get(cr, uid, ids, context=context))
+ return dict(self.name_get(cr, uid, ids, context=context))
_columns = {
'name': fields.char('Sales Team', size=64, required=True, translate=True),
@@ -117,27 +118,36 @@ class crm_case_section(osv.osv):
"true, it will allow you to hide the sales team without removing it."),
'change_responsible': fields.boolean('Reassign Escalated', help="When escalating to this team override the salesman with the team leader."),
'user_id': fields.many2one('res.users', 'Team Leader'),
- 'member_ids':fields.many2many('res.users', 'sale_member_rel', 'section_id', 'member_id', 'Team Members'),
+ 'member_ids': fields.many2many('res.users', 'sale_member_rel', 'section_id', 'member_id', 'Team Members'),
'reply_to': fields.char('Reply-To', size=64, help="The email address put in the 'Reply-To' of all emails sent by OpenERP about cases in this sales team"),
'parent_id': fields.many2one('crm.case.section', 'Parent Team'),
'child_ids': fields.one2many('crm.case.section', 'parent_id', 'Child Teams'),
'resource_calendar_id': fields.many2one('resource.calendar', "Working Time", help="Used to compute open days"),
'note': fields.text('Description'),
- 'working_hours': fields.float('Working Hours', digits=(16,2 )),
+ 'working_hours': fields.float('Working Hours', digits=(16, 2)),
'stage_ids': fields.many2many('crm.case.stage', 'section_stage_rel', 'section_id', 'stage_id', 'Stages'),
'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True,
help="The email address associated with this team. New emails received will automatically "
"create new leads assigned to the team."),
+ 'open_lead_ids': fields.one2many('crm.lead', 'section_id',
+ string='Open Leads', readonly=True,
+ domain=['&', ('type', '!=', 'opportunity'), ('state', 'not in', ['done', 'cancel'])]),
+ 'open_opportunity_ids': fields.one2many('crm.lead', 'section_id',
+ string='Open Opportunities', readonly=True,
+ domain=['&', '|', ('type', '=', 'opportunity'), ('type', '=', 'both'), ('state', 'not in', ['done', 'cancel'])]),
+ 'color': fields.integer('Color Index'),
+ 'use_leads': fields.boolean('Leads',
+ help="This enables the management of leads in the sales team. Otherwise the sales team manages only opportunities."),
}
def _get_stage_common(self, cr, uid, context):
- ids = self.pool.get('crm.case.stage').search(cr, uid, [('case_default','=',1)], context=context)
+ ids = self.pool.get('crm.case.stage').search(cr, uid, [('case_default', '=', 1)], context=context)
return ids
_defaults = {
'active': 1,
'stage_ids': _get_stage_common,
- 'alias_domain': False, # always hide alias during creation
+ 'use_leads': True,
}
_sql_constraints = [
@@ -150,7 +160,7 @@ class crm_case_section(osv.osv):
def name_get(self, cr, uid, ids, context=None):
"""Overrides orm name_get method"""
- if not isinstance(ids, list) :
+ if not isinstance(ids, list):
ids = [ids]
res = []
if not ids:
@@ -167,20 +177,20 @@ class crm_case_section(osv.osv):
def create(self, cr, uid, vals, context=None):
mail_alias = self.pool.get('mail.alias')
if not vals.get('alias_id'):
- vals.pop('alias_name', None) # prevent errors during copy()
+ alias_name = vals.pop('alias_name', None) or vals.get('name') # prevent errors during copy()
alias_id = mail_alias.create_unique_alias(cr, uid,
- {'alias_name': vals['name']},
+ {'alias_name': alias_name},
model_name="crm.lead",
context=context)
vals['alias_id'] = alias_id
res = super(crm_case_section, self).create(cr, uid, vals, context)
- mail_alias.write(cr, uid, [vals['alias_id']], {'alias_defaults': {'section_id': res, 'type':'lead'}}, context)
+ mail_alias.write(cr, uid, [vals['alias_id']], {'alias_defaults': {'section_id': res, 'type': 'lead'}}, context)
return res
def unlink(self, cr, uid, ids, context=None):
# Cascade-delete mail aliases as well, as they should not exist without the sales team.
mail_alias = self.pool.get('mail.alias')
- alias_ids = [team.alias_id.id for team in self.browse(cr, uid, ids, context=context) if team.alias_id ]
+ alias_ids = [team.alias_id.id for team in self.browse(cr, uid, ids, context=context) if team.alias_id]
res = super(crm_case_section, self).unlink(cr, uid, ids, context=context)
mail_alias.unlink(cr, uid, alias_ids, context=context)
return res
@@ -230,4 +240,5 @@ class crm_payment_mode(osv.osv):
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
}
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/crm/crm_case_section_view.xml b/addons/crm/crm_case_section_view.xml
new file mode 100644
index 00000000000..c788872b47e
--- /dev/null
+++ b/addons/crm/crm_case_section_view.xml
@@ -0,0 +1,294 @@
+
+
+
+
+
+
+
+ Leads
+ crm.lead
+ tree,form
+ ['|', ('type','=','lead'), ('type','=',False)]
+
+
+ {
+ 'search_default_section_id': [active_id],
+ 'search_default_open': 1,
+ 'default_section_id': active_id,
+ 'default_type': 'lead',
+ 'stage_type': 'lead',
+ }
+
+
+
+ Use leads if you need a qualification step before creating an
+ opportunity or a customer. It can be a business card you received,
+ a contact form filled in your website, or a file of unqualified
+ prospects you import, etc.
+
+ Once qualified, the lead can be converted into a business
+ opportunity and/or a new customer in your address book.
+
+ OpenERP helps you keep track of your sales pipeline to follow
+ up potential sales and better forecast your future revenues.
+
+ You will be able to plan meetings and phone calls from
+ opportunities, convert them into quotations, attach related
+ documents, track all discussions, and much more.
+
+ Use sales team to organize your different salespersons or
+ departments into separate teams. Each team will work in
+ its own list of opportunities.
+
+ Use sales team to organize your different salespersons or
+ departments into separate teams. Each team will work in
+ its own list of opportunities.
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/crm/crm_data.xml b/addons/crm/crm_data.xml
index 3db7a457dfd..f24aee13c1d 100644
--- a/addons/crm/crm_data.xml
+++ b/addons/crm/crm_data.xml
@@ -27,8 +27,10 @@
- Sales Department
+ SalesSales
+ True
+
@@ -64,12 +66,6 @@
To manage quotations and sale orders, install the "Sales Management" application.
]]>
-
- sales
-
-
- {'type':'lead'}
-
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 3f676329765..6d195fec383 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -85,6 +85,22 @@ class crm_lead(base_stage, format_address, osv.osv):
},
}
+ def get_empty_list_help(self, cr, uid, help, context=None):
+ if context.get('default_type') == 'lead':
+ context['empty_list_help_model'] = 'crm.case.section'
+ context['empty_list_help_id'] = context.get('default_section_id')
+ context['empty_list_help_document_name'] = _("leads")
+ return super(crm_lead, self).get_empty_list_help(cr, uid, help, context=context)
+
+ def onchange_user_id(self, cr, uid, ids, section_id, user_id, context=None):
+ """ When changing the user, also set a section_id or restrict section id
+ to the ones user_id is member of. """
+ if user_id:
+ section_ids = self.pool.get('crm.case.section').search(cr, uid, ['|', ('user_id', '=', user_id), ('member_ids', '=', user_id)], context=context)
+ if len(section_ids) > 0 and section_id not in section_ids:
+ section_id = section_ids[0]
+ return {'value': {'section_id': section_id}}
+
def create(self, cr, uid, vals, context=None):
if context is None:
context = {}
diff --git a/addons/crm/crm_lead_data.xml b/addons/crm/crm_lead_data.xml
index e410cbe3d85..0979a94eb3f 100644
--- a/addons/crm/crm_lead_data.xml
+++ b/addons/crm/crm_lead_data.xml
@@ -54,6 +54,7 @@
Won
+ done
diff --git a/addons/crm/crm_lead_menu.xml b/addons/crm/crm_lead_menu.xml
index 8c38ed41a1c..2226b4ac895 100644
--- a/addons/crm/crm_lead_menu.xml
+++ b/addons/crm/crm_lead_menu.xml
@@ -9,34 +9,23 @@
['|', ('type','=','lead'), ('type','=',False)]
- {'default_type':'lead', 'stage_type':'lead'}
-
-
- Click to create an unqualified lead.
-
- Use leads if you need a qualification step before creating an
- opportunity or a customer. It can be a business card you received,
- a contact form filled in your website, or a file of unqualified
- prospects you import, etc.
-
- Once qualified, the lead can be converted into a business
- opportunity and/or a new customer in your address book.
-
+ Use leads if you need a qualification step before creating an
+ opportunity or a customer. It can be a business card you received,
+ a contact form filled in your website, or a file of unqualified
+ prospects you import, etc.
+
+ Once qualified, the lead can be converted into a business
+ opportunity and/or a new customer in your address book.
+
- OpenERP helps you keep track of your sales pipeline to follow
- up potential sales and better forecast your future revenues.
-
- You will be able to plan meetings and phone calls from
- opportunities, convert them into quotations, attach related
- documents, track all discussions, and much more.
-
+
+ Click to create a new opportunity.
+
+ OpenERP helps you keep track of your sales pipeline to follow
+ up potential sales and better forecast your future revenues.
+
+ You will be able to plan meetings and phone calls from
+ opportunities, convert them into quotations, attach related
+ documents, track all discussions, and much more.
+
- Use sales team to organize your different salespersons or
- departments into separate teams. Each team will work in
- its own list of opportunities.
-
-
-
-
-
-
-
@@ -233,7 +130,7 @@
@@ -248,7 +145,7 @@
-
+
@@ -261,7 +158,7 @@
-
+
@@ -275,7 +172,7 @@
@@ -295,13 +192,6 @@
groups="base.group_no_one"
parent="base.menu_crm_config_lead"/>
-
- Cases by Sales Team
- crm.case.section
- [('parent_id','=',False)]
- tree
-
-
@@ -434,7 +324,7 @@
-
+
@@ -448,7 +338,7 @@
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index 0e5df8837f1..1009e1c376d 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -19,7 +19,8 @@
-
+
@@ -77,7 +78,8 @@
help="Leads/Opportunities that are assigned to one of the sale teams I manage"/>
-
+
@@ -134,7 +136,8 @@
-
+
diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml
index 1f1a4f91046..c27d876ddd7 100644
--- a/addons/crm/report/crm_phonecall_report_view.xml
+++ b/addons/crm/report/crm_phonecall_report_view.xml
@@ -11,7 +11,8 @@
-
+
@@ -59,7 +60,8 @@
help="Phone calls that are assigned to one of the sale teams I manage"/>
-
+
diff --git a/addons/crm/res_config.py b/addons/crm/res_config.py
index 229ad0189ff..ea37c24fe06 100644
--- a/addons/crm/res_config.py
+++ b/addons/crm/res_config.py
@@ -2,7 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Business Applications
-# Copyright (C) 2004-2012 OpenERP S.A. ().
+# Copyright (C) 2004-TODAY OpenERP S.A. ().
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -21,24 +21,51 @@
from openerp.osv import fields, osv
-class crm_configuration(osv.osv_memory):
+
+class crm_configuration(osv.TransientModel):
_name = 'sale.config.settings'
_inherit = ['sale.config.settings', 'fetchmail.config.settings']
+ def set_group_multi_salesteams(self, cr, uid, ids, context=None):
+ """ This method is automatically called by res_config as it begins
+ with set. It is used to implement the 'one group or another'
+ behavior. We have to perform some group manipulation by hand
+ because in res_config.execute(), set_* methods are called
+ after group_*; therefore writing on an hidden res_config file
+ could not work.
+ If group_multi_salesteams is checked: remove group_mono_salesteams
+ from group_user, remove the users. Otherwise, just add
+ group_mono_salesteams in group_user.
+ The inverse logic about group_multi_salesteams is managed by the
+ normal behavior of 'group_multi_salesteams' field.
+ """
+ def ref(xml_id):
+ mod, xml = xml_id.split('.', 1)
+ return self.pool['ir.model.data'].get_object(cr, uid, mod, xml, context)
+
+ for obj in self.browse(cr, uid, ids, context=context):
+ config_group = ref('base.group_mono_salesteams')
+ base_group = ref('base.group_user')
+ if obj.group_multi_salesteams:
+ base_group.write({'implied_ids': [(3, config_group.id)]})
+ config_group.write({'users': [(3, u.id) for u in base_group.users]})
+ else:
+ base_group.write({'implied_ids': [(4, config_group.id)]})
+ return True
+
_columns = {
- 'fetchmail_lead': fields.boolean("Create leads from incoming mails",
- fetchmail_model='crm.lead', fetchmail_name='Incoming Leads',
- help="""Allows you to configure your incoming mail server, and create leads from incoming emails."""),
'group_fund_raising': fields.boolean("Manage Fund Raising",
implied_group='crm.group_fund_raising',
help="""Allows you to trace and manage your activities for fund raising."""),
- 'module_crm_claim':fields.boolean("Manage Customer Claims",
+ 'module_crm_claim': fields.boolean("Manage Customer Claims",
help="""Allows you to track your customers/suppliers claims and grievances.
This installs the module crm_claim."""),
- 'module_crm_helpdesk':fields.boolean("Manage Helpdesk and Support",
- help="""Allows you to communicate with Customer, process Customer query, and provide better help and support. This installs the module crm_helpdesk."""),
-
-
+ 'module_crm_helpdesk': fields.boolean("Manage Helpdesk and Support",
+ help="""Allows you to communicate with Customer, process Customer query, and provide better help and support. This installs the module crm_helpdesk."""),
+ 'group_multi_salesteams': fields.boolean("Organize Sales activities into multiple Sales Teams",
+ implied_group='base.group_multi_salesteams',
+ help="""Allows you to use Sales Teams to manage your leads and opportunities."""),
}
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/crm/res_config_view.xml b/addons/crm/res_config_view.xml
index 9534c8620ee..547ce1c2ae6 100644
--- a/addons/crm/res_config_view.xml
+++ b/addons/crm/res_config_view.xml
@@ -22,20 +22,15 @@