mail_template_preview_views.xml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <data>
  4. <record id="mail_template_preview_view_form" model="ir.ui.view">
  5. <field name="name">mail.template.preview.view.form</field>
  6. <field name="model">mail.template.preview</field>
  7. <field name="arch" type="xml">
  8. <form string="Email Preview">
  9. <h3>Preview of <field name="mail_template_id" readonly="1" nolabel="1" options="{'no_open' : True}"/></h3>
  10. <div class="alert alert-danger" role="alert" attrs="{'invisible' : [('error_msg', '=', False)]}">
  11. <field name="error_msg" widget="text"/>
  12. </div>
  13. <field name="no_record" invisible="1"/>
  14. <div class="container">
  15. <div class="row">
  16. <span class="col-md-5 col-lg-4 col-sm-12 ps-0">Choose an example <field name="model_id" readonly="1"/> record:</span>
  17. <div class="col-md-7 col-lg-6 col-sm-12 ps-0">
  18. <field name="resource_ref" readonly="False" class="w-100"
  19. options="{'hide_model': True, 'no_create': True, 'no_open': True}"
  20. attrs="{'invisible': [('no_record', '=', True)]}"/>
  21. <b attrs="{'invisible': [('no_record', '=', False)]}" class="text-warning">No record for this model</b>
  22. </div>
  23. </div>
  24. <div class="row">
  25. <span class="col-md-5 col-lg-4 col-sm-12 ps-0">Force a language: </span>
  26. <div class="col-md-7 col-lg-6 col-sm-12 ps-0">
  27. <field name="lang" placeholder="Select a language" class="w-100"/>
  28. </div>
  29. </div>
  30. </div>
  31. <group>
  32. <field name="subject"/>
  33. <field name="email_from" attrs="{'invisible':[('email_from','=', False)]}"/>
  34. <field name="partner_ids" widget="many2many_tags" attrs="{'invisible':[('partner_ids', '=', [])]}"/>
  35. <field name="email_to" attrs="{'invisible':[('email_to','=', False)]}"/>
  36. <field name="email_cc" attrs="{'invisible':[('email_cc','=', False)]}"/>
  37. <field name="reply_to" attrs="{'invisible':[('reply_to','=', False)]}"/>
  38. <field name="scheduled_date" attrs="{'invisible':[('scheduled_date','=', False)]}"/>
  39. </group>
  40. <field name="body_html" widget="html" nolabel="1" options='{"safe": True}'/>
  41. <field name="attachment_ids" widget="many2many_binary"/>
  42. <footer>
  43. <button string="Close" class="btn-secondary" special="cancel" data-hotkey="z"/>
  44. </footer>
  45. </form>
  46. </field>
  47. </record>
  48. <record id="mail_template_preview_action" model="ir.actions.act_window">
  49. <field name="name">Template Preview</field>
  50. <field name="res_model">mail.template.preview</field>
  51. <field name="binding_model_id" eval="False"/>
  52. <field name="type">ir.actions.act_window</field>
  53. <field name="view_mode">form</field>
  54. <field name="view_id" ref="mail_template_preview_view_form"/>
  55. <field name="target">new</field>
  56. <field name="context">{'default_mail_template_id':active_id}</field>
  57. </record>
  58. </data>
  59. </odoo>