Pankita Shah(OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-bug-1071793-shp into
lp:openobject-addons.
Requested reviews:
Anto (abo-openerp)
Amit Patel (OpenERP) (apa-tiny)
Atul Patel(OpenERP) (atp-openerp)
Related bugs:
Bug #1071793 in OpenERP Addons: "[trunk] When user alters the stages for
leads, new leads won't get into draft mode"
https://bugs.launchpad.net/openobject-addons/+bug/1071793
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1071793-shp/+merge/133407
hello,
As per your suggestion i remove domain ,and get type from context.
and type['both'] which not remove because if we remove it then it breaks yml.
thanks
shp
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1071793-shp/+merge/133407
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-bug-1071793-shp.
=== modified file 'crm/crm_lead.py'
--- crm/crm_lead.py 2012-11-07 16:30:37 +0000
+++ crm/crm_lead.py 2012-11-08 05:28:27 +0000
@@ -50,7 +50,7 @@
def _get_default_stage_id(self, cr, uid, context=None):
""" Gives default stage_id """
section_id = self._get_default_section_id(cr, uid, context=context)
- return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft'), ('type', '=', 'both')], context=context)
+ return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft')], context=context)
def _resolve_section_id_from_context(self, cr, uid, context=None):
""" Returns ID of section based on the value of 'section_id'
@@ -224,11 +224,7 @@
multi='day_close', type="float", store=True),
'state': fields.related('stage_id', 'state', type="selection", store=True,
selection=crm.AVAILABLE_STATES, string="Status", readonly=True,
- help='The Status is set to \'Draft\', when a case is created.\
- If the case is in progress the Status is set to \'Open\'.\
- When the case is over, the Status is set to \'Done\'.\
- If the case needs to be reviewed then the Status is \
- set to \'Pending\'.'),
+ help='The Status is set to \'Draft\', when a case is created. If the case is in progress the Status is set to \'Open\'. When the case is over, the Status is set to \'Done\'. If the case needs to be reviewed then the Status is set to \'Pending\'.'),
# Only used for type opportunity
'probability': fields.float('Success Rate (%)',group_operator="avg"),
@@ -328,7 +324,7 @@
cases = self.browse(cr, uid, ids2, context=context)
return self._action(cr, uid, cases, False, context=context)
- def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None):
+ 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:
- type: stage type must be the same or 'both'
@@ -341,6 +337,9 @@
# collect all section_ids
section_ids = []
types = ['both']
+ if not cases :
+ type = context.get('default_type')
+ types += [type]
if section_id:
section_ids.append(section_id)
for lead in cases:
=== modified file 'crm/crm_lead_view.xml'
--- crm/crm_lead_view.xml 2012-11-06 15:08:13 +0000
+++ crm/crm_lead_view.xml 2012-11-08 05:28:27 +0000
@@ -14,9 +14,9 @@
<record id="action_crm_lead_unread" model="ir.values">
<field name="name">action_crm_lead_unread</field>
<field name="action_id" ref="actions_server_crm_lead_unread"/>
- <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_unread'))" />
+ <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_unread'))"/>
<field name="key">action</field>
- <field name="model_id" ref="model_crm_lead" />
+ <field name="model_id" ref="model_crm_lead"/>
<field name="model">crm.lead</field>
<field name="key2">client_action_multi</field>
</record>
@@ -32,9 +32,9 @@
<record id="action_crm_lead_read" model="ir.values">
<field name="name">action_crm_lead_read</field>
<field name="action_id" ref="actions_server_crm_lead_read"/>
- <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_read'))" />
+ <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_read'))"/>
<field name="key">action</field>
- <field name="model_id" ref="model_crm_lead" />
+ <field name="model_id" ref="model_crm_lead"/>
<field name="model">crm.lead</field>
<field name="key2">client_action_multi</field>
</record>
@@ -143,7 +143,7 @@
<div class="oe_right oe_button_box" name="buttons">
<button type="action"
name="%(act_crm_opportunity_crm_phonecall_new)d"
- string="Phone Calls" />
+ string="Phone Calls"/>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Lead Description"/>
@@ -167,13 +167,13 @@
</div>
</group>
<group>
- <label for="contact_name" />
+ <label for="contact_name"/>
<div>
<field name="contact_name" class="oe_inline"/>,
<field name="title" placeholder="Title" domain="[('domain', '=', 'contact')]" class="oe_inline" options='{"no_open": True}'/>
</div>
<field name="email_from" widget="email"/>
- <field name="function" />
+ <field name="function"/>
<field name="phone"/>
<field name="mobile"/>
<field name="fax"/>
@@ -209,14 +209,14 @@
<group string="Categorization">
<field name="company_id"
groups="base.group_multi_company"
- widget="selection" colspan="2" />
+ widget="selection" colspan="2"/>
<field name="type_id" widget="selection"/>
<field name="channel_id" widget="selection"/>
<field name="referred"/>
<field name="state" groups="base.group_no_one"/>
</group>
<group string="Mailings">
- <field name="opt_out" />
+ <field name="opt_out"/>
</group>
</group>
</page>
@@ -253,12 +253,12 @@
<field name="create_date" groups="base.group_no_one"/>
<field name="name"/>
<field name="contact_name"/>
- <field name="country_id" invisible="context.get('invisible_country', True)" />
+ <field name="country_id" invisible="context.get('invisible_country', True)"/>
<field name="email_from"/>
<field name="phone"/>
<field name="stage_id"/>
<field name="user_id" invisible="1"/>
- <field name="section_id" invisible="context.get('invisible_section', True)" />
+ <field name="section_id" invisible="context.get('invisible_section', True)"/>
<field name="state" invisible="1"/>
<field name="type_id" invisible="1"/>
<field name="referred" invisible="1"/>
@@ -276,8 +276,8 @@
<field name="arch" type="xml">
<calendar string="Leads Generation"
date_start="date_action" color="user_id">
- <field name="name" />
- <field name="partner_name" />
+ <field name="name"/>
+ <field name="partner_name"/>
</calendar>
</field>
</record>
@@ -354,14 +354,14 @@
<field name="arch" type="xml">
<search string="Search Leads">
<field name="name" string="Lead / Customer" filter_domain="['|','|',('partner_name','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/>
- <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike',self)]" />
+ <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike',self)]"/>
<field name="create_date"/>
<filter icon="terp-mail-message-new" string="Unread Messages" help="Unread messages" name="message_unread" domain="[('message_unread','=',True)]"/>
<separator/>
<filter icon="terp-check" string="New" name="new" help="New Leads" domain="[('state','=','draft')]"/>
<filter icon="terp-camera_test" string="In Progress" name="open" domain="[('state','=','open')]"/>
<separator/>
- <filter string="Unassigned Leads" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Leads" />
+ <filter string="Unassigned Leads" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Leads"/>
<separator/>
<filter string="Leads Assigned to Me or My Team(s)" icon="terp-personal+" context="{'invisible_section': False}"
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
@@ -373,8 +373,8 @@
<filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
<filter string="Referrer" icon="terp-personal" domain="[]" context="{'group_by':'referred'}"/>
- <filter string="Campaign" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'type_id'}" />
- <filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}" />
+ <filter string="Campaign" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'type_id'}"/>
+ <filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}"/>
<separator orientation="vertical"/>
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="Creation" help="Create date" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" groups="base.group_no_one"/>
@@ -415,7 +415,7 @@
name="action_makeMeeting"
type="object"
context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}"
- />
+ />
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
@@ -452,7 +452,7 @@
<label for="section_id"/>
<div>
<field name="section_id" widget="selection"/>
- <button name="case_escalate" string="Escalate" type="object" states="draft,open,pending" />
+ <button name="case_escalate" string="Escalate" type="object" states="draft,open,pending"/>
</div>
</group>
<group>
@@ -485,12 +485,12 @@
</group>
<group>
- <label for="contact_name" />
+ <label for="contact_name"/>
<div>
<field name="contact_name" class="oe_inline"/>
<field name="title" placeholder="Title" domain="[('domain', '=', 'contact')]" options='{"no_open": True}' class="oe_inline"/>
</div>
- <field name="function" />
+ <field name="function"/>
<field name="mobile"/>
<field name="fax"/>
</group>
@@ -500,7 +500,7 @@
<field name="channel_id" widget="selection"/>
</group>
<group string="Mailings">
- <field name="opt_out" />
+ <field name="opt_out"/>
</group>
<group string="Misc">
<field name="active"/>
@@ -542,15 +542,15 @@
<field name="create_date" groups="base.group_no_one"/>
<field name="name" string="Opportunity"/>
<field name="partner_id" string="Customer"/>
- <field name="country_id" invisible="context.get('invisible_country', True)" />
+ <field name="country_id" invisible="context.get('invisible_country', True)"/>
<field name="date_action"/>
- <field name="title_action" />
+ <field name="title_action"/>
<field name="channel_id" invisible="1"/>
<field name="type_id" invisible="1"/>
<field name="stage_id"/>
<field name="planned_revenue" sum="Expected Revenues"/>
<field name="probability" widget="progressbar" avg="Avg. of Probability"/>
- <field name="section_id" invisible="context.get('invisible_section', True)" />
+ <field name="section_id" invisible="context.get('invisible_section', True)"/>
<field name="user_id"/>
<field name="priority" invisible="1"/>
<field name="state" groups="base.group_no_one"/>
@@ -568,30 +568,30 @@
<search string="Search Opportunities">
<field name="name" string="Opportunity / Customer"
filter_domain="['|','|','|',('partner_id','ilike',self),('partner_name','ilike',self),('email_from','ilike',self),('name', 'ilike', self)]"/>
- <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike', self)]" />
+ <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike', self)]"/>
<filter icon="terp-mail-message-new" string="Unread Messages" help="Unread messages" name="message_unread" domain="[('message_unread','=',True)]"/>
<separator/>
<filter icon="terp-check" string="New" help="New Opportunities" name="new" domain="[('state','=','draft')]"/>
<filter icon="terp-camera_test" string="In Progress" help="Open Opportunities" name="open" domain="[('state','=','open')]"/>
<separator/>
- <filter string="Unassigned Opportunities" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Opportunities" />
+ <filter string="Unassigned Opportunities" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Opportunities"/>
<separator/>
<filter string="Opportunities Assigned to Me or My Team(s)" icon="terp-personal+"
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}"
- help="Opportunities that are assigned to either me or one of the sale teams I manage" />
+ help="Opportunities that are assigned to either me or one of the sale teams I manage"/>
<field name="user_id"/>
<field name="section_id" context="{'invisible_section': False, 'default_section_id': self}"/>
<field name="partner_id"/>
<group expand="0" string="Group By..." colspan="16">
- <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}" />
+ <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Team" help="Sales Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
<filter string="Customer" help="Partner" icon="terp-personal+" domain="[]" context="{'group_by':'partner_id'}"/>
- <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}" />
- <filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" />
+ <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
+ <filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}"/>
<filter string="Campaign" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'type_id'}"/>
- <filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}" />
+ <filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}"/>
<filter string="Creation" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" groups="base.group_no_one"/>
- <filter string="Exp.Closing" icon="terp-go-month" help="Expected Closing" domain="[]" context="{'group_by':'date_deadline'}" />
+ <filter string="Exp.Closing" icon="terp-go-month" help="Expected Closing" domain="[]" context="{'group_by':'date_deadline'}"/>
</group>
<group string="Display">
<filter string="Show Sales Team" icon="terp-personal+" context="{'invisible_section': False}" domain="[]" help="Show Sales Team"/>
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp