return res
_columns = {
+ 'resource_calendar_id': fields.many2one('resource.calendar', "Working Time", help="Used to compute open days"),
'stage_ids': fields.many2many('crm.case.stage', 'section_stage_rel', 'section_id', 'stage_id', 'Stages'),
'use_leads': fields.boolean('Leads',
help="The first contact you get with a potential customer is a lead you qualify before converting it into a real business opportunity. Check this box to manage leads in this sales team."),
-
'monthly_open_leads': fields.function(_get_opportunities_data,
type="string", readonly=True, multi='_get_opportunities_data',
string='Open Leads per Month'),
'monthly_planned_revenue': fields.function(_get_opportunities_data,
type="string", readonly=True, multi='_get_opportunities_data',
string='Planned Revenue per Month'),
- 'resource_calendar_id': fields.many2one('resource.calendar', "Working Time", help="Used to compute open days"),
}
def _get_stage_common(self, cr, uid, context):
<field name="model">crm.case.section</field>
<field name="inherit_id" ref="sale_team.crm_case_section_salesteams_view_kanban"/>
<field name="arch" type="xml">
- <data>
- <xpath expr="//field[@name='name']" position="after">
- <field name="use_leads"/>
- <field name="monthly_open_leads"/>
- <field name="monthly_planned_revenue"/>
- </xpath>
- <xpath expr="//div[@name='avtar']" position="after">
- <div class="oe_kanban_alias oe_center" t-if="record.use_leads.raw_value and record.alias_id.value">
- <small><span class="oe_e oe_e_alias" style="float: none;">%%</span><t t-raw="record.alias_id.raw_value[1]"/></small>
- </div>
- <div class="oe_items_list">
- <div class="oe_salesteams_leads" t-if="record.use_leads.raw_value">
- <a name="%(crm_case_form_view_salesteams_lead)d" type="action">Leads</a>
- <a name="%(action_report_crm_lead_salesteam)d" type="action" class="oe_sparkline_bar_link">
- <field name="monthly_open_leads" widget="sparkline_bar"
- options="{'height': '20px', 'barWidth': 4, 'barSpacing': 1, 'delayIn': '3000', 'tooltip_suffix': ' Leads'}">Open Leads per Month<br/>Click to see a detailed analysis of leads.</field>
- </a>
+ <data>
+ <xpath expr="//field[@name='name']" position="after">
+ <field name="use_leads"/>
+ <field name="monthly_open_leads"/>
+ <field name="monthly_planned_revenue"/>
+ </xpath>
+ <xpath expr="//div[@name='avtar']" position="after">
+ <div class="oe_kanban_alias oe_center" t-if="record.use_leads.raw_value and record.alias_id.value">
+ <small><span class="oe_e oe_e_alias" style="float: none;">%%</span><t t-raw="record.alias_id.raw_value[1]"/></small>
</div>
- <div class="oe_salesteams_opportunities">
- <a name="%(crm_case_form_view_salesteams_opportunity)d" type="action">Opportunities</a>
- <a name="%(action_report_crm_opportunity_salesteam)d" type="action">
- <field name="monthly_planned_revenue" widget="sparkline_bar"
- options="{'height': '20px', 'barWidth': '4', 'barSpacing': '1', 'delayIn': '3000', 'tooltip_suffix': ' (Planned Revenue)'}">Planned Revenue per Month<br/>Click to see a detailed analysis of opportunities.</field>
- </a>
+ <div class="oe_items_list">
+ <div class="oe_salesteams_leads" t-if="record.use_leads.raw_value">
+ <a name="%(crm_case_form_view_salesteams_lead)d" type="action">Leads</a>
+ <a name="%(action_report_crm_lead_salesteam)d" type="action" class="oe_sparkline_bar_link">
+ <field name="monthly_open_leads" widget="sparkline_bar"
+ options="{'height': '20px', 'barWidth': 4, 'barSpacing': 1, 'delayIn': '3000', 'tooltip_suffix': ' Leads'}">Open Leads per Month<br/>Click to see a detailed analysis of leads.</field>
+ </a>
+ </div>
+ <div class="oe_salesteams_opportunities">
+ <a name="%(crm_case_form_view_salesteams_opportunity)d" type="action">Opportunities</a>
+ <a name="%(action_report_crm_opportunity_salesteam)d" type="action">
+ <field name="monthly_planned_revenue" widget="sparkline_bar"
+ options="{'height': '20px', 'barWidth': '4', 'barSpacing': '1', 'delayIn': '3000', 'tooltip_suffix': ' (Planned Revenue)'}">Planned Revenue per Month<br/>Click to see a detailed analysis of opportunities.</field>
+ </a>
+ </div>
</div>
- </div>
- </xpath>
- </data>
- </field>
+ </xpath>
+ </data>
+ </field>
</record>
<!-- Case Sections Action -->
-
<record model="ir.actions.act_window.view" id="action_crm_tag_kanban_view_salesteams_oppor11">
<field name="sequence" eval="0"/>
<field name="view_mode">kanban</field>
resource_id = resource_ids[0]
duration = float(ans.days)
-
if lead.section_id and lead.section_id.resource_calendar_id:
duration = float(ans.days) * 24
new_dates = cal_obj.interval_get(cr,
if user.default_section_id and user.default_section_id.id:
return {'value': {'section_id': user.default_section_id.id}}
return {'value': {'section_id': section_id}}
-
+
def stage_find(self, cr, uid, cases, section_id, domain=None, order='sequence', context=None):
""" Override of the base.stage method
Parameter of the stage search taken from the lead:
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
-
<record id="group_fund_raising" model="res.groups">
<field name="name">Manage Fund Raising</field>
<field name="category_id" ref="base.module_category_hidden"/>
_logger.exception(_('Invalid return content from the evaluation of code for definition %s' % definition.name))
else: # count or sum
+
obj = self.pool.get(definition.model_id.model)
field_date_name = definition.field_date_id and definition.field_date_id.name or False
if not value:
continue
goal = all_goals[goal_id]
+
# check goal target reached
if (goal.definition_condition == 'higher' and value.get('current', goal.current) >= goal.target_goal) \
or (goal.definition_condition == 'lower' and value.get('current', goal.current) <= goal.target_goal):
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
+
import sales_crm_account_invoice_report
import sale_report
import sale_analysis_report
<?xml version="1.0" encoding="utf-8"?>
<openerp>
- <data>
+ <data>
<record id="view_order_product_search_sale_crm_inherit" model="ir.ui.view">
<field name="name">sale.report.search.sale.crm</field>
<field name="model">sale.report</field>
</filter>
</field>
</record>
- </data>
+ </data>
</openerp>
\ No newline at end of file
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
+
import calendar
from openerp import tools
from datetime import date, datetime, timedelta
# Care for deprecated _inv_get() hook - FIXME: to be removed after 6.1
invoice_vals.update(self._inv_get(cr, uid, order, context=context))
return invoice_vals
-
def _make_invoice(self, cr, uid, order, lines, context=None):
inv_obj = self.pool.get('account.invoice')
context = dict(context, mail_post_autofollow=True)
self.pool.get('sale.order').signal_quotation_sent(cr, uid, [context['default_res_id']])
return super(mail_compose_message, self).send_mail(cr, uid, ids, context=context)
-
class account_invoice(osv.Model):
_inherit = 'account.invoice'
+
_columns = {
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
}
</field>
</record>
-
<!-- search by Salesteams -->
-
<record id="action_orders_salesteams" model="ir.actions.act_window">
<field name="name">Sales Orders</field>
<field name="type">ir.actions.act_window</field>
import wizard
import sale_crm
-import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+++ /dev/null
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
</field>
</field>
</record>
- </data>
+ </data>
</openerp>
import sale_team
import sale_team_config
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
'website': 'http://www.openerp.com',
'depends' : ['base','mail','web_kanban_sparkline',],
'data': ['security/sale_team_security.xml',
+ 'security/ir.model.access.csv',
'res_config_view.xml',
- 'ir.model.access.csv',
'sale_team_data.xml',
'sale_team.xml',],
'demo': ['sale_team_demo.xml'],
+++ /dev/null
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_crm_case_section,crm.case.section,model_crm_case_section,base.group_user,1,0,0,0
-access_crm_case_section_user,crm.case.section.user,model_crm_case_section,base.group_sale_salesman,1,0,0,0
-access_crm_case_section_manager,crm.case.section.manager,model_crm_case_section,base.group_sale_manager,1,1,1,1
-
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
-
<record id="view_sale_config_settings" model="ir.ui.view">
<field name="name">crm settings</field>
<field name="model">sale.team.config.settings</field>
<field name="inherit_id" ref="base_setup.view_sale_config_settings"/>
<field name="arch" type="xml">
<data>
- <div name="config_sale" position="before">
- <separator string="Sales Teams"/>
- <group>
- <label for="id" string="Manage Sales Teams"/>
- <div>
+ <div name="config_sale" position="before">
+ <separator string="Sales Teams"/>
+ <group>
+ <label for="id" string="Manage Sales Teams"/>
<div>
- <field name="group_multi_salesteams" class="oe_inline"/>
- <label for="group_multi_salesteams"/>
+ <div>
+ <field name="group_multi_salesteams" class="oe_inline"/>
+ <label for="group_multi_salesteams"/>
+ </div>
</div>
-
- </div>
- </group>
- </div>
- </data></field>
+ </group>
+ </div>
+ </data>
+ </field>
</record>
- </data>
+ </data>
</openerp>
#
##############################################################################
-
import calendar
from datetime import date, datetime
from dateutil import relativedelta
-
from openerp import tools
from openerp.osv import fields
from openerp.osv import osv
-
-
class crm_case_section(osv.osv):
_name = "crm.case.section"
_inherit = ['mail.thread', 'ir.needaction_mixin']
# duplicate list to avoid modifying the original reference
self.SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
self.SELF_WRITEABLE_FIELDS.extend(['default_section_id'])
- return init_res
-
-
-
\ No newline at end of file
+ return init_res
\ No newline at end of file
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form_simple_modif"/>
<field name="arch" type="xml">
- <data>
+ <data>
<xpath expr="//field[@name='company_id']" position="before">
<field name="default_section_id" readonly="0"/>
</xpath>
</field>
</record>
-
-
<!-- Case Sections Search view -->
-
<record id="crm_case_section_salesteams_search" model="ir.ui.view">
<field name="name">Case Sections - Search</field>
<field name="model">crm.case.section</field>
</record>
<!-- Case Sections Action -->
-
<record id="crm_case_section_salesteams_act" model="ir.actions.act_window">
<field name="name">Sales Teams</field>
<field name="res_model">crm.case.section</field>
</record>
<!-- Case Sections Tree View -->
-
<record id="crm_case_section_view_tree" model="ir.ui.view">
<field name="name">crm.case.section.tree</field>
<field name="model">crm.case.section</field>
</field>
</record>
- <!-- Case Sections Action -->
-
- <!--<record model="ir.actions.act_window.view" id="action_crm_tag_kanban_view_salesteams_oppor11">
- <field name="sequence" eval="0"/>
- <field name="view_mode">kanban</field>
- <field name="view_id" ref="crm_case_kanban_view_leads"/>
- <field name="act_window_id" ref="crm_case_form_view_salesteams_opportunity"/>
- </record>-->
-
<record id="crm_case_section_act" model="ir.actions.act_window">
<field name="name">Sales Teams</field>
<field name="res_model">crm.case.section</field>
</p>
</field>
</record>
-
<menuitem id="sale_team.menu_sale_team_act" action="crm_case_section_salesteams_act" sequence="1" parent="base.menu_sales"/>
- </data>
+ </data>
</openerp>
\ No newline at end of file
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
-
class sala_team_configuration(osv.TransientModel):
_name = 'sale.team.config.settings'
_inherit = ['sale.config.settings', 'fetchmail.config.settings']
return True
_columns = {
-
'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."""),
- }
-
-
-
+ }
\ No newline at end of file
<field name="code">SPD</field>
<field name="member_ids" eval="[(4, ref('base.user_root')),(4, ref('base.user_demo'))]"/>
</record>
-
</data>
</openerp>
\ No newline at end of file
--- /dev/null
+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
+access_crm_case_section,crm.case.section,model_crm_case_section,base.group_user,1,0,0,0
+access_crm_case_section_user,crm.case.section.user,model_crm_case_section,base.group_sale_salesman,1,0,0,0
+access_crm_case_section_manager,crm.case.section.manager,model_crm_case_section,base.group_sale_manager,1,1,1,1
\ No newline at end of file
<record model="ir.ui.menu" id="base.menu_base_config">
<field eval="[(4, ref('base.group_sale_manager'))]" name="groups_id"/>
</record>
-
</data>
</openerp>