Merge lp:~camptocamp/openerp-crm/crm_lead_stage_monitoring_vre into lp:~crm-core-editors/openerp-crm/7.0

Proposed by Vincent Renaville@camptocamp
Status: Merged
Merged at revision: 5
Proposed branch: lp:~camptocamp/openerp-crm/crm_lead_stage_monitoring_vre
Merge into: lp:~crm-core-editors/openerp-crm/7.0
Diff against target: 271 lines (+240/-0)
6 files modified
crm_lead_stage_monitoring/__init__.py (+21/-0)
crm_lead_stage_monitoring/__openerp__.py (+39/-0)
crm_lead_stage_monitoring/crm.py (+46/-0)
crm_lead_stage_monitoring/crm_view.xml (+86/-0)
crm_lead_stage_monitoring/i18n/crm_lead_stage_monitoring.pot (+24/-0)
crm_lead_stage_monitoring/i18n/fr.po (+24/-0)
To merge this branch: bzr merge lp:~camptocamp/openerp-crm/crm_lead_stage_monitoring_vre
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) Approve
Alexandre Fayolle - camptocamp code review, no test Approve
Romain Deheele - Camptocamp (community) code review Approve
Review via email: mp+213836@code.launchpad.net

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Romain Deheele - Camptocamp (romaindeheele) wrote :

Hi,

LGTM,

Romain

review: Approve (code review)
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

rename crm_lead_stage_monitoring/i18n/crm_lead_stage_monitoring.po to crm_lead_stage_monitoring/i18n/crm_lead_stage_monitoring.pot

s/dupplicate/duplicate/

module description could be improved.

review: Needs Fixing (code review, no test)
5. By Vincent Renaville@camptocamp

[FIX] change file extension for base translation

6. By Vincent Renaville@camptocamp

[FIX] typo

7. By Vincent Renaville@camptocamp

[FIX] change module description

Revision history for this message
Vincent Renaville@camptocamp (vrenaville-c2c) wrote :

Hello,

Alexandre thanks for the review.

I have fixed according to your review.

Vincent

8. By Vincent Renaville@camptocamp

[FIX] test for default dict

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM

thanks for the fixes

review: Approve (code review, no test)
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Only nitpicking, so I approve, but still:

#54 most module versions i know are x.y, any reason for having x.y.z?
#55 I'd use 'Customer Relationship Management' or 'Sales', both exist in standard OpenERP
#57,58 'Current' should be lower case

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'crm_lead_stage_monitoring'
2=== added file 'crm_lead_stage_monitoring/__init__.py'
3--- crm_lead_stage_monitoring/__init__.py 1970-01-01 00:00:00 +0000
4+++ crm_lead_stage_monitoring/__init__.py 2014-04-03 06:59:28 +0000
5@@ -0,0 +1,21 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# Copyright (c) 2014 Camptocamp SA (http://www.camptocamp.com)
10+# @author Vincent Renaville
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU Affero General Public License as
14+# published by the Free Software Foundation, either version 3 of the
15+# License, or (at your option) any later version.
16+#
17+# This program is distributed in the hope that it will be useful,
18+# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+# GNU Affero General Public License for more details.
21+#
22+# You should have received a copy of the GNU Affero General Public License
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24+#
25+##############################################################################
26+from . import crm
27
28=== added file 'crm_lead_stage_monitoring/__openerp__.py'
29--- crm_lead_stage_monitoring/__openerp__.py 1970-01-01 00:00:00 +0000
30+++ crm_lead_stage_monitoring/__openerp__.py 2014-04-03 06:59:28 +0000
31@@ -0,0 +1,39 @@
32+# -*- coding: utf-8 -*-
33+##############################################################################
34+#
35+# Copyright (c) 2014 Camptocamp SA (http://www.camptocamp.com)
36+# @author Vincent Renaville
37+#
38+# This program is free software: you can redistribute it and/or modify
39+# it under the terms of the GNU Affero General Public License as
40+# published by the Free Software Foundation, either version 3 of the
41+# License, or (at your option) any later version.
42+#
43+# This program is distributed in the hope that it will be useful,
44+# but WITHOUT ANY WARRANTY; without even the implied warranty of
45+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46+# GNU Affero General Public License for more details.
47+#
48+# You should have received a copy of the GNU Affero General Public License
49+# along with this program. If not, see <http://www.gnu.org/licenses/>.
50+#
51+##############################################################################
52+
53+{'name': 'CRM - Add last activity on stage field',
54+ 'version': '1.0.0',
55+ 'category': 'other',
56+ 'description': """This module allow the sale manager to have a quick review of recent stage change on his lead/opportunities.
57+Each time a lead/opportunity switches from a stage to on other, the Current stage date is updated.
58+You can make "group by" and search on the Current stage date field
59+""",
60+ 'author': 'Camptocamp',
61+ 'website': 'http://www.camptocamp.com',
62+ 'depends': ['crm'],
63+ 'data': [
64+ 'crm_view.xml'
65+ ],
66+ 'demo_xml': [],
67+ 'test': [],
68+ 'installable': True,
69+ 'active': False,
70+ }
71
72=== added file 'crm_lead_stage_monitoring/crm.py'
73--- crm_lead_stage_monitoring/crm.py 1970-01-01 00:00:00 +0000
74+++ crm_lead_stage_monitoring/crm.py 2014-04-03 06:59:28 +0000
75@@ -0,0 +1,46 @@
76+# -*- coding: utf-8 -*-
77+##############################################################################
78+#
79+# Copyright (c) 2014 Camptocamp SA (http://www.camptocamp.com)
80+# @author Vincent Renaville
81+#
82+# This program is free software: you can redistribute it and/or modify
83+# it under the terms of the GNU Affero General Public License as
84+# published by the Free Software Foundation, either version 3 of the
85+# License, or (at your option) any later version.
86+#
87+# This program is distributed in the hope that it will be useful,
88+# but WITHOUT ANY WARRANTY; without even the implied warranty of
89+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
90+# GNU Affero General Public License for more details.
91+#
92+# You should have received a copy of the GNU Affero General Public License
93+# along with this program. If not, see <http://www.gnu.org/licenses/>.
94+#
95+##############################################################################
96+from openerp.osv import orm, fields
97+from openerp import tools
98+from openerp.tools.translate import _
99+
100+
101+class CrmLead(orm.Model):
102+
103+ _inherit = "crm.lead"
104+
105+ _columns = {
106+ 'last_activity_stage': fields.date('Current stage date',
107+ readonly=True)
108+ }
109+
110+ def write(self, cr, uid, ids, vals, context=None):
111+ if vals.get('stage_id'):
112+ ## Add the last_activity_stage for the current date
113+ vals['last_activity_stage'] = fields.datetime.now()
114+ return super(CrmLead, self).write(cr, uid, ids, vals, context=context)
115+
116+ def copy(self, cr, uid, id, default=None, context=None):
117+ if default is None:
118+ default = {}
119+ ## Do not duplicate last_activity_stage
120+ default['last_activity_stage'] = False
121+ return super(CrmLead, self).copy(cr, uid, id, default, context=context)
122
123=== added file 'crm_lead_stage_monitoring/crm_view.xml'
124--- crm_lead_stage_monitoring/crm_view.xml 1970-01-01 00:00:00 +0000
125+++ crm_lead_stage_monitoring/crm_view.xml 2014-04-03 06:59:28 +0000
126@@ -0,0 +1,86 @@
127+<openerp>
128+ <data>
129+
130+ <!-- Lead -->
131+ <record id="view_crm_case_leads_filter_last_activity_stage" model="ir.ui.view">
132+ <field name="name">CRM - Lead last activity stage search</field>
133+ <field name="model">crm.lead</field>
134+ <field name="inherit_id" ref="crm.view_crm_case_leads_filter"/>
135+ <field name="arch" type="xml">
136+ <xpath expr="//field[@name='user_id']" position="after">
137+ <field name="last_activity_stage"/>
138+ </xpath>
139+ <xpath expr="//filter[@string='Salesperson']" position="after">
140+ <filter string="Current stage date" domain="[]" context="{'group_by':'last_activity_stage'}"/>
141+ </xpath>
142+ </field>
143+ </record>
144+
145+
146+
147+ <record id="crm_case_tree_view_leads_last_activity_stage" model="ir.ui.view">
148+ <field name="name">CRM - Lead last activity stage</field>
149+ <field name="model">crm.lead</field>
150+ <field name="inherit_id" ref="crm.crm_case_tree_view_leads"/>
151+ <field name="arch" type="xml">
152+ <xpath expr="//field[@name='stage_id']" position="after">
153+ <field name="last_activity_stage"/>
154+ </xpath>
155+ </field>
156+ </record>
157+
158+ <record id="crm_case_form_view_leads_last_activity_stage" model="ir.ui.view">
159+ <field name="name">CRM - Lead last activity stage form</field>
160+ <field name="model">crm.lead</field>
161+ <field name="inherit_id" ref="crm.crm_case_form_view_leads"/>
162+ <field name="arch" type="xml">
163+ <xpath expr="//field[@name='user_id']" position="after">
164+ <field name="last_activity_stage"/>
165+ </xpath>
166+ </field>
167+ </record>
168+
169+
170+
171+ <!-- Opportunity -->
172+
173+ <record id="view_crm_case_opportunities_filter_last_activity_stage" model="ir.ui.view">
174+ <field name="name">CRM - Opportunities last activity stage search</field>
175+ <field name="model">crm.lead</field>
176+ <field name="inherit_id" ref="crm.view_crm_case_opportunities_filter"/>
177+ <field name="arch" type="xml">
178+ <xpath expr="//field[@name='user_id']" position="after">
179+ <field name="last_activity_stage"/>
180+ </xpath>
181+ <xpath expr="//filter[@string='Salesperson']" position="after">
182+ <filter string="Current stage date" domain="[]" context="{'group_by':'last_activity_stage'}"/>
183+ </xpath>
184+ </field>
185+ </record>
186+
187+ <record id="crm_case_tree_view_leads_last_opportunities_stage" model="ir.ui.view">
188+ <field name="name">CRM - Lead last activity stage</field>
189+ <field name="model">crm.lead</field>
190+ <field name="inherit_id" ref="crm.crm_case_tree_view_oppor"/>
191+ <field name="arch" type="xml">
192+ <xpath expr="//field[@name='stage_id']" position="after">
193+ <field name="last_activity_stage"/>
194+ </xpath>
195+ </field>
196+ </record>
197+
198+
199+ <record id="crm_case_form_view_leads_last_opportunities_stage" model="ir.ui.view">
200+ <field name="name">CRM - opportunities last activity stage form</field>
201+ <field name="model">crm.lead</field>
202+ <field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
203+ <field name="arch" type="xml">
204+ <xpath expr="//field[@name='user_id']" position="after">
205+ <field name="last_activity_stage"/>
206+ </xpath>
207+ </field>
208+ </record>
209+
210+
211+ </data>
212+</openerp>
213
214=== added directory 'crm_lead_stage_monitoring/i18n'
215=== added file 'crm_lead_stage_monitoring/i18n/crm_lead_stage_monitoring.pot'
216--- crm_lead_stage_monitoring/i18n/crm_lead_stage_monitoring.pot 1970-01-01 00:00:00 +0000
217+++ crm_lead_stage_monitoring/i18n/crm_lead_stage_monitoring.pot 2014-04-03 06:59:28 +0000
218@@ -0,0 +1,24 @@
219+# Translation of OpenERP Server.
220+# This file contains the translation of the following modules:
221+# * crm_lead_stage_monitoring
222+#
223+msgid ""
224+msgstr ""
225+"Project-Id-Version: OpenERP Server 7.0\n"
226+"Report-Msgid-Bugs-To: \n"
227+"POT-Creation-Date: 2014-04-02 12:16+0000\n"
228+"PO-Revision-Date: 2014-04-02 12:16+0000\n"
229+"Last-Translator: <>\n"
230+"Language-Team: \n"
231+"MIME-Version: 1.0\n"
232+"Content-Type: text/plain; charset=UTF-8\n"
233+"Content-Transfer-Encoding: \n"
234+"Plural-Forms: \n"
235+
236+#. module: crm_lead_stage_monitoring
237+#: view:crm.lead:0
238+#: field:crm.lead,last_activity_stage:0
239+msgid "Current stage date"
240+msgstr ""
241+
242+
243
244=== added file 'crm_lead_stage_monitoring/i18n/fr.po'
245--- crm_lead_stage_monitoring/i18n/fr.po 1970-01-01 00:00:00 +0000
246+++ crm_lead_stage_monitoring/i18n/fr.po 2014-04-03 06:59:28 +0000
247@@ -0,0 +1,24 @@
248+# Translation of OpenERP Server.
249+# This file contains the translation of the following modules:
250+# * crm_lead_stage_monitoring
251+#
252+msgid ""
253+msgstr ""
254+"Project-Id-Version: OpenERP Server 7.0\n"
255+"Report-Msgid-Bugs-To: \n"
256+"POT-Creation-Date: 2014-04-02 12:16+0000\n"
257+"PO-Revision-Date: 2014-04-02 12:16+0000\n"
258+"Last-Translator: <>\n"
259+"Language-Team: \n"
260+"MIME-Version: 1.0\n"
261+"Content-Type: text/plain; charset=UTF-8\n"
262+"Content-Transfer-Encoding: \n"
263+"Plural-Forms: \n"
264+
265+#. module: crm_lead_stage_monitoring
266+#: view:crm.lead:0
267+#: field:crm.lead,last_activity_stage:0
268+msgid "Current stage date"
269+msgstr "Date du stage"
270+
271+

Subscribers

People subscribed via source and target branches