crm-core-editors team mailing list archive
-
crm-core-editors team
-
Mailing list archive
-
Message #00005
[Merge] lp:~camptocamp/openerp-crm/crm_lead_stage_monitoring_vre into lp:openerp-crm
Vincent Renaville@camptocamp has proposed merging lp:~camptocamp/openerp-crm/crm_lead_stage_monitoring_vre into lp:openerp-crm.
Requested reviews:
OpenERP CRM Core Editors (crm-core-editors)
For more details, see:
https://code.launchpad.net/~camptocamp/openerp-crm/crm_lead_stage_monitoring_vre/+merge/213836
Hello,
This module add the possibility to monitor when a lead/opportunity have change stage last time.
It's used to let the sale manager to view opportunities that he must to resend an email or a phone call.
--
https://code.launchpad.net/~camptocamp/openerp-crm/crm_lead_stage_monitoring_vre/+merge/213836
Your team OpenERP CRM Core Editors is requested to review the proposed merge of lp:~camptocamp/openerp-crm/crm_lead_stage_monitoring_vre into lp:openerp-crm.
=== added directory 'crm_lead_stage_monitoring'
=== added file 'crm_lead_stage_monitoring/__init__.py'
--- crm_lead_stage_monitoring/__init__.py 1970-01-01 00:00:00 +0000
+++ crm_lead_stage_monitoring/__init__.py 2014-04-02 12:37:42 +0000
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2014 Camptocamp SA (http://www.camptocamp.com)
+# @author Vincent Renaville
+#
+# 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 . import crm
=== added file 'crm_lead_stage_monitoring/__openerp__.py'
--- crm_lead_stage_monitoring/__openerp__.py 1970-01-01 00:00:00 +0000
+++ crm_lead_stage_monitoring/__openerp__.py 2014-04-02 12:37:42 +0000
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2014 Camptocamp SA (http://www.camptocamp.com)
+# @author Vincent Renaville
+#
+# 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/>.
+#
+##############################################################################
+
+{'name': 'CRM - Add last activity on stage field',
+ 'version': '1.0.0',
+ 'category': 'other',
+ 'description': """CRM Last activity on stage""",
+ 'author': 'Camptocamp',
+ 'website': 'http://www.camptocamp.com',
+ 'depends': ['crm'],
+ 'data': [
+ 'crm_view.xml'
+ ],
+ 'demo_xml': [],
+ 'test': [],
+ 'installable': True,
+ 'active': False,
+ }
=== added file 'crm_lead_stage_monitoring/crm.py'
--- crm_lead_stage_monitoring/crm.py 1970-01-01 00:00:00 +0000
+++ crm_lead_stage_monitoring/crm.py 2014-04-02 12:37:42 +0000
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2014 Camptocamp SA (http://www.camptocamp.com)
+# @author Vincent Renaville
+#
+# 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.osv import orm, fields
+from openerp import tools
+from openerp.tools.translate import _
+
+
+class CrmLead(orm.Model):
+
+ _inherit = "crm.lead"
+
+ _columns = {
+ 'last_activity_stage': fields.date('Current stage date',
+ readonly=True)
+ }
+
+ def write(self, cr, uid, ids, vals, context=None):
+ if vals.get('stage_id'):
+ ## Add the last_activity_stage for the current date
+ vals['last_activity_stage'] = fields.datetime.now()
+ return super(CrmLead, self).write(cr, uid, ids, vals, context=context)
+
+ def copy(self, cr, uid, id, default=None, context=None):
+ if not default:
+ default = {}
+ ## Do not dupplicate last_activity_stage
+ default['last_activity_stage'] = False
+ return super(CrmLead, self).copy(cr, uid, id, default, context=context)
=== added file 'crm_lead_stage_monitoring/crm_view.xml'
--- crm_lead_stage_monitoring/crm_view.xml 1970-01-01 00:00:00 +0000
+++ crm_lead_stage_monitoring/crm_view.xml 2014-04-02 12:37:42 +0000
@@ -0,0 +1,86 @@
+<openerp>
+ <data>
+
+ <!-- Lead -->
+ <record id="view_crm_case_leads_filter_last_activity_stage" model="ir.ui.view">
+ <field name="name">CRM - Lead last activity stage search</field>
+ <field name="model">crm.lead</field>
+ <field name="inherit_id" ref="crm.view_crm_case_leads_filter"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='user_id']" position="after">
+ <field name="last_activity_stage"/>
+ </xpath>
+ <xpath expr="//filter[@string='Salesperson']" position="after">
+ <filter string="Current stage date" domain="[]" context="{'group_by':'last_activity_stage'}"/>
+ </xpath>
+ </field>
+ </record>
+
+
+
+ <record id="crm_case_tree_view_leads_last_activity_stage" model="ir.ui.view">
+ <field name="name">CRM - Lead last activity stage</field>
+ <field name="model">crm.lead</field>
+ <field name="inherit_id" ref="crm.crm_case_tree_view_leads"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='stage_id']" position="after">
+ <field name="last_activity_stage"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="crm_case_form_view_leads_last_activity_stage" model="ir.ui.view">
+ <field name="name">CRM - Lead last activity stage form</field>
+ <field name="model">crm.lead</field>
+ <field name="inherit_id" ref="crm.crm_case_form_view_leads"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='user_id']" position="after">
+ <field name="last_activity_stage"/>
+ </xpath>
+ </field>
+ </record>
+
+
+
+ <!-- Opportunity -->
+
+ <record id="view_crm_case_opportunities_filter_last_activity_stage" model="ir.ui.view">
+ <field name="name">CRM - Opportunities last activity stage search</field>
+ <field name="model">crm.lead</field>
+ <field name="inherit_id" ref="crm.view_crm_case_opportunities_filter"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='user_id']" position="after">
+ <field name="last_activity_stage"/>
+ </xpath>
+ <xpath expr="//filter[@string='Salesperson']" position="after">
+ <filter string="Current stage date" domain="[]" context="{'group_by':'last_activity_stage'}"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="crm_case_tree_view_leads_last_opportunities_stage" model="ir.ui.view">
+ <field name="name">CRM - Lead last activity stage</field>
+ <field name="model">crm.lead</field>
+ <field name="inherit_id" ref="crm.crm_case_tree_view_oppor"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='stage_id']" position="after">
+ <field name="last_activity_stage"/>
+ </xpath>
+ </field>
+ </record>
+
+
+ <record id="crm_case_form_view_leads_last_opportunities_stage" model="ir.ui.view">
+ <field name="name">CRM - opportunities last activity stage form</field>
+ <field name="model">crm.lead</field>
+ <field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='user_id']" position="after">
+ <field name="last_activity_stage"/>
+ </xpath>
+ </field>
+ </record>
+
+
+ </data>
+</openerp>
=== added directory 'crm_lead_stage_monitoring/i18n'
=== added file 'crm_lead_stage_monitoring/i18n/crm_lead_stage_monitoring.po'
--- crm_lead_stage_monitoring/i18n/crm_lead_stage_monitoring.po 1970-01-01 00:00:00 +0000
+++ crm_lead_stage_monitoring/i18n/crm_lead_stage_monitoring.po 2014-04-02 12:37:42 +0000
@@ -0,0 +1,24 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * crm_lead_stage_monitoring
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-04-02 12:16+0000\n"
+"PO-Revision-Date: 2014-04-02 12:16+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: crm_lead_stage_monitoring
+#: view:crm.lead:0
+#: field:crm.lead,last_activity_stage:0
+msgid "Current stage date"
+msgstr ""
+
+
=== added file 'crm_lead_stage_monitoring/i18n/fr.po'
--- crm_lead_stage_monitoring/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ crm_lead_stage_monitoring/i18n/fr.po 2014-04-02 12:37:42 +0000
@@ -0,0 +1,24 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * crm_lead_stage_monitoring
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-04-02 12:16+0000\n"
+"PO-Revision-Date: 2014-04-02 12:16+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: crm_lead_stage_monitoring
+#: view:crm.lead:0
+#: field:crm.lead,last_activity_stage:0
+msgid "Current stage date"
+msgstr "Date du stage"
+
+
Follow ups