summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Francois <tfr@openerp.com>2010-12-13 10:39:59 +0100
committerThibault Francois <tfr@openerp.com>2010-12-13 10:39:59 +0100
commitf856489f5b2105f3d50e1c7d93d2711b5b6f1669 (patch)
tree0d7a4ef3c60cd0cf7706c475222f6b7b10745b44
parentd34186d12f03a2bf0d0f663c6b0f5c9ad16dfbec (diff)
[FIX] crm_view.xml : section_ids in view
bzr revid: tfr@openerp.com-20101213093959-z97zekyeg75q0svw
-rw-r--r--addons/crm/crm.py12
-rw-r--r--addons/crm/crm_lead_view.xml6
-rw-r--r--addons/crm/crm_view.xml1
3 files changed, 8 insertions, 11 deletions
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index a91009583f2..5336bdd23fb 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -139,8 +139,6 @@ class crm_case(object):
def _find_next_stage(self, cr, uid, stage_list, index, current_seq, stage_pool, context=None):
if index + 1 == len(stage_list):
return False
- print "cul"
- print index
next_stage_id = stage_list[index + 1]
next_stage = stage_pool.browse(cr, uid, next_stage_id, context=context)
if not next_stage:
@@ -148,10 +146,9 @@ class crm_case(object):
next_seq = next_stage.sequence
if (abs(next_seq - current_seq)) >= 1:
- print next_stage
return next_stage
else :
- return _find_next_stage(cr, uid, stage_list, index + 1, current_seq, stage_pool)
+ return self._find_next_stage(cr, uid, stage_list, index + 1, current_seq, stage_pool)
def stage_change(self, cr, uid, ids, context=None, order='sequence'):
if not context:
@@ -161,10 +158,9 @@ class crm_case(object):
current_seq = False
next_stage_id = False
for case in self.browse(cr, uid, ids, context):
- print case
next_stage = False
data = {}
- print stage_type
+
domain = [('type', '=', stage_type),('section_ids', '=', case.section_id.id)]
if case.section_id and case.section_id.stage_ids:
domain.append(('id', 'in', map(lambda x: x.id, case.section_id.stage_ids)))
@@ -174,8 +170,7 @@ class crm_case(object):
index = -1
if case.stage_id and case.stage_id.id in stages:
index = stages.index(case.stage_id.id)
- print stages
- print "call"
+
next_stage = self._find_next_stage(cr, uid, stages, index, current_seq, stage_pool, context=context)
if next_stage:
next_stage_id = next_stage.id
@@ -635,6 +630,7 @@ class crm_case_stage(osv.osv):
_columns = {
'section_ids':fields.many2many('crm.case.section', 'section_stage_rel', 'stage_id', 'section_id', 'Sections'),
}
+
crm_case_stage()
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index 87eb7ff3bd1..979ab26cfd1 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -57,14 +57,14 @@
<newline />
<field name="section_id" widget="selection" />
<field name="user_id" />
- <field name="stage_id" domain="[('type','=','lead'),('section_ids', '=', section_id)]"/>
+ <field name="stage_id" domain="[('type','=','lead'),('section_ids', '=', section_id)]" />
<group col="2" colspan="1">
<button name="stage_previous" string=""
states="open,pending,draft" type="object"
- icon="gtk-go-back" context="{'stage_type': 'lead'}"/>
+ icon="gtk-go-back" context="{'stage_type': 'lead'}" />
<button name="stage_next" string=""
states="open,pending,draft" type="object"
- icon="gtk-go-forward" />
+ icon="gtk-go-forward" context="{'stage_type': 'lead'}" />
</group>
<field name="type" invisible="1"/>
</group>
diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml
index 8de6b3ab3a6..f0c2d55a642 100644
--- a/addons/crm/crm_view.xml
+++ b/addons/crm/crm_view.xml
@@ -123,6 +123,7 @@
<separator string="Stage Definition" colspan="4"/>
<field name="name" select="1"/>
<field name="type" invisible="1" />
+ <field name="section_ids" invisible="1" />
<field name="sequence"/>
<field name="probability"/>
<field name="on_change"/>