account_move_views.xml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <data>
  4. <record id="account_edi.action_open_edi_documents" model="ir.actions.act_window">
  5. <field name="name">Electronic invoicing</field>
  6. <field name="res_model">account.edi.document</field>
  7. <field name="view_mode">tree</field>
  8. <field name="domain">[('move_id', '=', active_id), ('error', '!=', False)]</field>
  9. </record>
  10. <record id="view_out_invoice_tree_inherit" model="ir.ui.view">
  11. <field name="name">account.move.tree.inherit</field>
  12. <field name="model">account.move</field>
  13. <field name="inherit_id" ref="account.view_out_invoice_tree" />
  14. <field name="arch" type="xml">
  15. <field name="state" position="before">
  16. <field name="edi_state" optional="hide"/>
  17. <field name="edi_blocking_level" optional="hide"/>
  18. <field name="edi_error_message" optional="hide"/>
  19. </field>
  20. </field>
  21. </record>
  22. <record id="view_out_credit_note_tree_inherit" model="ir.ui.view">
  23. <field name="name">account.move.tree.inherit</field>
  24. <field name="model">account.move</field>
  25. <field name="inherit_id" ref="account.view_out_credit_note_tree" />
  26. <field name="arch" type="xml">
  27. <field name="state" position="before">
  28. <field name="edi_state" optional="hide"/>
  29. <field name="edi_blocking_level" optional="hide"/>
  30. <field name="edi_error_message" optional="hide"/>
  31. </field>
  32. </field>
  33. </record>
  34. <record id="view_in_invoice_refund_tree_inherit" model="ir.ui.view">
  35. <field name="name">account.move.tree.inherit</field>
  36. <field name="model">account.move</field>
  37. <field name="inherit_id" ref="account.view_in_invoice_refund_tree" />
  38. <field name="arch" type="xml">
  39. <field name="state" position="before">
  40. <field name="edi_state" optional="hide"/>
  41. <field name="edi_blocking_level" optional="hide"/>
  42. <field name="edi_error_message" optional="hide"/>
  43. </field>
  44. </field>
  45. </record>
  46. <record id="view_account_invoice_filter" model="ir.ui.view">
  47. <field name="name">account.invoice.select.inherit</field>
  48. <field name="model">account.move</field>
  49. <field name="inherit_id" ref="account.view_account_invoice_filter"/>
  50. <field name="arch" type="xml">
  51. <xpath expr="//search/group/filter[@name='status']" position="after">
  52. <filter string="Electronic invoicing state" name="edi_state" groups="base.group_no_one"
  53. context="{'group_by': 'edi_state'}"/>
  54. <separator/>
  55. <filter string="Electronic invoicing processing needed" name="edi_to_process" groups="base.group_no_one"
  56. domain="[('edi_state', 'in', [('to_send'), ('to_cancel')])]"/>
  57. </xpath>
  58. </field>
  59. </record>
  60. <record id="view_move_form_inherit" model="ir.ui.view">
  61. <field name="name">account.move.form.inherit</field>
  62. <field name="model">account.move</field>
  63. <field name="inherit_id" ref="account.view_move_form" />
  64. <field name="arch" type="xml">
  65. <xpath expr="//button[@name='button_cancel']" position="after">
  66. <field name="edi_show_cancel_button" invisible="1"/>
  67. <field name="edi_show_abandon_cancel_button" invisible="1"/>
  68. <button name="button_cancel_posted_moves"
  69. string="Request EDI Cancellation"
  70. type="object"
  71. groups="account.group_account_invoice"
  72. attrs="{'invisible' : [('edi_show_cancel_button', '=', False)]}"/>
  73. <button name="button_abandon_cancel_posted_posted_moves"
  74. string="Call off EDI Cancellation"
  75. type="object"
  76. groups="account.group_account_invoice"
  77. attrs="{'invisible' : [('edi_show_abandon_cancel_button', '=', False)]}"/>
  78. </xpath>
  79. <xpath expr="//header" position="after">
  80. <field name="edi_blocking_level" invisible="1" />
  81. <field name="edi_error_count" invisible="1" />
  82. <div class="alert alert-info" role="alert" style="margin-bottom:0px;"
  83. attrs="{'invisible': ['|', ('edi_web_services_to_process', 'in', ['', False]), ('state', '=', 'draft')]}">
  84. <div>The invoice will be processed asynchronously by the following E-invoicing service :
  85. <field name="edi_web_services_to_process" class="oe_inline"/>
  86. </div>
  87. <button name="button_process_edi_web_services" type="object" class="oe_link" string="Process now" />
  88. </div>
  89. <div class="alert alert-danger" role="alert" style="margin-bottom:0px;"
  90. attrs="{'invisible': ['|', ('edi_error_count', '=', 0), ('edi_blocking_level', '!=', 'error')]}">
  91. <div class="o_row">
  92. <field name="edi_error_message" />
  93. <button name="%(account_edi.action_open_edi_documents)d" string="⇒ See errors" type="action" class="oe_link" attrs="{'invisible': [('edi_error_count', '=', 1)]}" />
  94. <button name="action_retry_edi_documents_error" type="object" class="oe_link oe_inline" string="Retry" />
  95. </div>
  96. </div>
  97. <div class="alert alert-warning" role="alert" style="margin-bottom:0px;"
  98. attrs="{'invisible': ['|', ('edi_error_count', '=', 0), ('edi_blocking_level', '!=', 'warning')]}">
  99. <div class="o_row">
  100. <field name="edi_error_message" />
  101. <button name="%(account_edi.action_open_edi_documents)d" string="⇒ See errors" type="action" class="oe_link" attrs="{'invisible': [('edi_error_count', '=', 1)]}" />
  102. </div>
  103. </div>
  104. <div class="alert alert-info" role="alert" style="margin-bottom:0px;"
  105. attrs="{'invisible': ['|', ('edi_error_count', '=', 0), ('edi_blocking_level', '!=', 'info')]}">
  106. <div class="o_row">
  107. <field name="edi_error_message" />
  108. <button name="%(account_edi.action_open_edi_documents)d" string="⇒ See errors" type="action" class="oe_link" attrs="{'invisible': [('edi_error_count', '=', 1)]}" />
  109. </div>
  110. </div>
  111. </xpath>
  112. <xpath expr="//div[@name='journal_div']" position="after">
  113. <field name="edi_state" attrs="{'invisible': ['|', ('edi_state', '=', False), ('state', '=', 'draft')]}"/>
  114. </xpath>
  115. <xpath expr="//page[@id='other_tab']" position="after">
  116. <page id="edi_documents"
  117. string="EDI Documents"
  118. groups="base.group_no_one"
  119. attrs="{'invisible': [('edi_document_ids', '=', [])]}">
  120. <field name="edi_document_ids">
  121. <tree create="false" delete="false" edit="false" decoration-danger="error" no_open="1">
  122. <field name="name"/>
  123. <field name="edi_format_name"/>
  124. <field name="state"/>
  125. <field name="error" invisible="1"/>
  126. <field name="blocking_level" invisible="1"/>
  127. <button name="action_export_xml"
  128. type="object"
  129. class="oe_link oe_inline"
  130. string="Download"
  131. groups="base.group_no_one"
  132. attrs="{'invisible': ['|', ('error', '=', False), ('blocking_level', '=', 'info')]}"/>
  133. </tree>
  134. </field>
  135. </page>
  136. </xpath>
  137. </field>
  138. </record>
  139. </data>
  140. </odoo>