<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
<field name="arch" type="xml">
<xpath expr="/form[@string='Opportunities']/group/button[@string='Schedule Call']" position="after">
- <button string="Quotation" icon="terp-sale" name="%(sale_crm_wizard)d" type="action"/>
- <group colspan="7" col="7">
- <label colspan="6" string=""/>
- <button string="Convert to Quote" icon="terp-sale" name="%(sale_crm_wizard)d" type="action"/>
- </group>
++ <button string="Convert to Quote" icon="terp-sale" name="%(sale_crm_wizard)d" type="action"/>
++ <label colspan="6" string=""/>
</xpath>
</field>
</record>
if data['form']['close']:
case_obj.case_close(cr, uid, data['ids'])
-
- value = {
- 'domain': str([('id', 'in', new_ids)]),
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'sale.order',
- 'view_id': False,
- 'type': 'ir.actions.act_window',
- 'search_view_id': id['res_id']
- }
++
++ if not new_ids:
++ return {}
+
+ if len(new_ids)<=1:
+ value = {
+ 'domain': str([('id', 'in', new_ids)]),
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'sale.order',
+ 'view_id': False,
+ 'type': 'ir.actions.act_window',
+ 'res_id': new_ids and new_ids[0]
+ }
+ else:
+ value = {
+ 'domain': str([('id', 'in', new_ids)]),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'sale.order',
+ 'view_id': False,
+ 'type': 'ir.actions.act_window',
+ 'res_id':new_ids
+ }
+
return value
states = {