website_visitor_views.xml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo><data>
  3. <record id="website_visitor_view_form" model="ir.ui.view">
  4. <field name="name">website.visitor.view.form.inherit.website.mass.mailing.sms</field>
  5. <field name="model">website.visitor</field>
  6. <field name="inherit_id" ref="website.website_visitor_view_form"/>
  7. <field name="arch" type="xml">
  8. <xpath expr="//header" position="inside">
  9. <button name="action_send_sms" type="object" class="btn btn-primary"
  10. attrs="{'invisible': [('mobile', '=', False)]}" string="Send SMS"/>
  11. </xpath>
  12. </field>
  13. </record>
  14. <record id="website_visitor_view_kanban" model="ir.ui.view">
  15. <field name="name">website.visitor.view.kanban.inherit.website.sms</field>
  16. <field name="model">website.visitor</field>
  17. <field name="inherit_id" ref="website.website_visitor_view_kanban"/>
  18. <field name="arch" type="xml">
  19. <field name="page_ids" position="after">
  20. <field name="mobile" widget="phone"/>
  21. </field>
  22. <xpath expr="//div[hasclass('w_visitor_kanban_actions')]" position="inside">
  23. <button name="action_send_sms" type="object" class="btn btn-secondary"
  24. attrs="{'invisible': [('mobile', '=', False)]}">SMS
  25. </button>
  26. </xpath>
  27. <xpath expr="//div[hasclass('w_visitor_kanban_actions_ungrouped')]" position="inside">
  28. <button name="action_send_sms" type="object" class="btn btn-secondary border"
  29. attrs="{'invisible': [('mobile', '=', False)]}">SMS
  30. </button>
  31. </xpath>
  32. </field>
  33. </record>
  34. <record id="website_visitor_view_tree" model="ir.ui.view">
  35. <field name="name">website.visitor.view.tree.inherit.website.sms</field>
  36. <field name="model">website.visitor</field>
  37. <field name="inherit_id" ref="website.website_visitor_view_tree"/>
  38. <field name="arch" type="xml">
  39. <xpath expr="//field[@name='is_connected']" position="before">
  40. <field name="mobile" invisible="1"/>
  41. </xpath>
  42. <xpath expr="//button[@name='action_send_mail']" position="after">
  43. <button name="action_send_sms" type="object" icon="fa-mobile"
  44. attrs="{'invisible': [('mobile', '=', False)]}" string="SMS"/>
  45. </xpath>
  46. </field>
  47. </record>
  48. </data></odoo>