account_invoice_send_views.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <data>
  4. <record id="account_invoice_send_wizard_form" model="ir.ui.view">
  5. <field name="name">account.invoice.send.form</field>
  6. <field name="model">account.invoice.send</field>
  7. <field name="groups_id" eval="[(4,ref('base.group_user'))]"/>
  8. <field name="arch" type="xml">
  9. <form string="Invoice send &amp; Print">
  10. <div class="alert alert-warning" role="alert"
  11. attrs="{'invisible': [('move_types', '=', False)]}">
  12. You have selected the following document types at the same time:
  13. <field name="move_types"/>
  14. </div>
  15. <!-- truly invisible fields for control and options -->
  16. <field name="composition_mode" invisible="1"/>
  17. <field name="invoice_ids" invisible="1"/>
  18. <field name="email_from" invisible="1" />
  19. <field name="mail_server_id" invisible="1"/>
  20. <div name="option_print">
  21. <field name="is_print" />
  22. <b><label for="is_print"/></b>
  23. <div name="info_form"
  24. attrs="{'invisible': ['|', ('is_print', '=', False), ('composition_mode', '=', 'mass_mail')]}"
  25. class="text-center text-muted d-inline-block ms-2">
  26. Preview as a PDF
  27. </div>
  28. </div>
  29. <div name="option_email">
  30. <field name="is_email" />
  31. <b><label for="is_email"/></b>
  32. </div>
  33. <div class="text-start d-inline-block mr8" attrs="{'invisible': ['|', ('is_email','=', False), ('invoice_without_email', '=', False)]}">
  34. <field name="invoice_without_email" class="mr4"/>
  35. </div>
  36. <div name="mail_form" attrs="{'invisible': [('is_email', '=', False)]}">
  37. <!-- visible wizard -->
  38. <div attrs="{'invisible': [('composition_mode', '=', 'mass_mail')]}">
  39. <group>
  40. <label for="partner_ids" string="Recipients" groups="base.group_user"/>
  41. <div groups="base.group_user">
  42. <span attrs="{'invisible': [('composition_mode', '!=', 'mass_mail')]}">
  43. <strong>Email mass mailing</strong> on
  44. <span>the selected records</span>
  45. </span>
  46. <span>Followers of the document and</span>
  47. <field name="partner_ids" widget="many2many_tags_email" placeholder="Add contacts to notify..."
  48. context="{'force_email':True, 'show_email':True}" attrs="{'invisible': [('composition_mode', '=', 'mass_mail')]}"/>
  49. </div>
  50. <field name="subject" placeholder="Subject..." attrs="{'required': [('is_email', '=', True), ('composition_mode', '=', 'comment')]}"/>
  51. </group>
  52. <field name="body" class="oe-bordered-editor" options="{'style-inline': true}"/>
  53. </div>
  54. <group>
  55. <group attrs="{'invisible': [('composition_mode', '=', 'mass_mail')]}">
  56. <field name="attachment_ids" widget="many2many_binary" string="Attach a file" nolabel="1" colspan="2" attrs="{'invisible': [('composition_mode', '=', 'mass_mail')]}"/>
  57. </group>
  58. <group>
  59. <field name="template_id" options="{'no_create': True, 'no_edit': True}"
  60. context="{'default_model': 'account.move'}"/>
  61. </group>
  62. </group>
  63. </div>
  64. <footer>
  65. <button string="Send &amp; Print"
  66. attrs="{'invisible': ['|', ('is_email', '=', False), ('is_print', '=', False)]}" data-hotkey="q"
  67. name="send_and_print_action" type="object" class="send_and_print btn-primary o_mail_send"/>
  68. <button string="Send" data-hotkey="q"
  69. attrs="{'invisible': ['|', ('is_print', '=', True), ('is_email', '=', False)]}"
  70. name="send_and_print_action" type="object" class="send btn-primary o_mail_send"/>
  71. <button string="Print" data-hotkey="q"
  72. attrs="{'invisible': ['|', ('is_print', '=', False), ('is_email', '=', True)]}"
  73. name="send_and_print_action" type="object" class="print btn-primary o_mail_send"/>
  74. <button string="Cancel" class="btn-secondary" special="cancel" data-hotkey="z" />
  75. <button icon="fa-lg fa-save" type="object" name="save_as_template" string="Save as new template"
  76. attrs="{'invisible': ['|', ('composition_mode', '=', 'mass_mail'), ('is_email', '=', False)]}"
  77. class="float-end btn-secondary" help="Save as a new template" data-hotkey="w" />
  78. </footer>
  79. </form>
  80. </field>
  81. </record>
  82. <record id="invoice_send" model="ir.actions.server">
  83. <field name="name">Send &amp; print</field>
  84. <field name="state">code</field>
  85. <field name="type">ir.actions.server</field>
  86. <field name="model_id" ref="model_account_move"/>
  87. <field name="binding_model_id" ref="model_account_move"/>
  88. <field name="binding_view_types">list</field>
  89. <field name="code">
  90. if records:
  91. action = records.action_send_and_print()
  92. </field>
  93. </record>
  94. </data>
  95. </odoo>