You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.6 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- Tree view -->
  4. <record id="view_sendgrid_template_tree" model="ir.ui.view">
  5. <field name="name">sendgrid.template.tree</field>
  6. <field name="model">sendgrid.template</field>
  7. <field name="arch" type="xml">
  8. <tree string="Templates">
  9. <field name="remote_id"/>
  10. <field name="name"/>
  11. </tree>
  12. </field>
  13. </record>
  14. <!-- Form view -->
  15. <record id="view_sendgrid_template_form" model="ir.ui.view">
  16. <field name="name">sendgrid.template.form</field>
  17. <field name="model">sendgrid.template</field>
  18. <field name="arch" type="xml">
  19. <form string="Template">
  20. <sheet>
  21. <group>
  22. <field name="name"/>
  23. <field name="remote_id"/>
  24. <field name="detected_keywords"/>
  25. </group>
  26. <notebook>
  27. <page string="Html">
  28. <field name="html_content"/>
  29. </page>
  30. <page string="Plain text">
  31. <field name="plain_content"/>
  32. </page>
  33. </notebook>
  34. </sheet>
  35. </form>
  36. </field>
  37. </record>
  38. <!-- Action opening the tree view -->
  39. <record id="open_view_sendgrid_template_tree" model="ir.actions.act_window">
  40. <field name="name">Template</field>
  41. <field name="res_model">sendgrid.template</field>
  42. <field name="view_type">form</field>
  43. <field name="view_mode">form,tree</field>
  44. <field name="view_id" ref="view_sendgrid_template_tree"/>
  45. </record>
  46. <record model="ir.actions.server" id="update_sendgrid_templates">
  47. <field name="name">Update Sendgrid Templates</field>
  48. <field name="model_id" ref="model_sendgrid_template"/>
  49. <field name="code">
  50. self.update(cr, uid, context=context)
  51. action = {
  52. 'name': 'Sendgrid templates',
  53. 'type': 'ir.actions.act_window',
  54. 'res_model': 'sendgrid.template',
  55. 'view_type': 'form',
  56. 'view_mode': 'tree,form'
  57. }
  58. </field>
  59. </record>
  60. <!-- Add menu entry in Settings/Email -->
  61. <menuitem name="SendGrid Templates" id="menu_sendgrid_template"
  62. parent="base.menu_email"
  63. sequence="8"
  64. action="open_view_sendgrid_template_tree"/>
  65. <menuitem name="Update SendGrid" id="menu_update_sendgrid_template"
  66. parent="base.menu_email"
  67. sequence="9"
  68. action="update_sendgrid_templates"/>
  69. </odoo>