ir_action_data.xml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!--
  4. 'Mark as Lost' in action dropdown
  5. -->
  6. <record id="action_mark_as_lost" model="ir.actions.server">
  7. <field name="name">Mark as lost</field>
  8. <field name="model_id" ref="model_crm_lead"/>
  9. <field name="binding_model_id" ref="crm.model_crm_lead"/>
  10. <field name="binding_view_types">list</field>
  11. <field name="state">code</field>
  12. <field name="code">
  13. if not 'opportunity' in records.mapped('type'):
  14. records.action_set_lost()
  15. elif records:
  16. action_values = env.ref('crm.crm_lead_lost_action').sudo().read()[0]
  17. action_values.update({'context': env.context})
  18. action = action_values
  19. </field>
  20. </record>
  21. <record id="action_your_pipeline" model="ir.actions.server">
  22. <field name="name">Crm: My Pipeline</field>
  23. <field name="model_id" ref="crm.model_crm_team"/>
  24. <field name="state">code</field>
  25. <field name="groups_id" eval="[(4, ref('base.group_user'))]"/>
  26. <field name="code">action = model.action_your_pipeline()</field>
  27. </record>
  28. <record id="action_opportunity_forecast" model="ir.actions.server">
  29. <field name="name">Crm: Forecast</field>
  30. <field name="model_id" ref="crm.model_crm_team"/>
  31. <field name="state">code</field>
  32. <field name="groups_id" eval="[(4, ref('base.group_user'))]"/>
  33. <field name="code">action = model.action_opportunity_forecast()</field>
  34. </record>
  35. </odoo>