| 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <odoo> |
| 3 | <data> |
| 4 | |
| 5 | <record id="account_edi.action_open_edi_documents" model="ir.actions.act_window"> |
| 6 | <field name="name">Electronic invoicing</field> |
| 7 | <field name="res_model">account.edi.document</field> |
| 8 | <field name="view_mode">list</field> |
| 9 | <field name="domain">[('move_id', '=', active_id), ('error', '!=', False)]</field> |
| 10 | </record> |
| 11 | |
| 12 | <record id="view_out_invoice_tree_inherit" model="ir.ui.view"> |
| 13 | <field name="name">account.move.list.inherit</field> |
| 14 | <field name="model">account.move</field> |
| 15 | <field name="inherit_id" ref="account.view_out_invoice_tree" /> |
| 16 | <field name="arch" type="xml"> |
| 17 | <field name="status_in_payment" position="before"> |
| 18 | <field name="edi_state" optional="hide" class="fw-bold" |
| 19 | decoration-muted="edi_blocking_level == 'info'" |
| 20 | decoration-danger="edi_blocking_level == 'error'" |
| 21 | decoration-warning="edi_blocking_level == 'warning'" |
| 22 | /> |
| 23 | <field name="edi_blocking_level" optional="hide"/> |
| 24 | <field name="edi_error_message" optional="hide"/> |
| 25 | </field> |
| 26 | </field> |
| 27 | </record> |
| 28 | |
| 29 | <record id="view_out_credit_note_tree_inherit" model="ir.ui.view"> |
| 30 | <field name="name">account.move.list.inherit</field> |
| 31 | <field name="model">account.move</field> |
| 32 | <field name="inherit_id" ref="account.view_out_credit_note_tree" /> |
| 33 | <field name="arch" type="xml"> |
| 34 | <field name="status_in_payment" position="before"> |
| 35 | <field name="edi_state" optional="hide"/> |
| 36 | <field name="edi_blocking_level" optional="hide"/> |
| 37 | <field name="edi_error_message" optional="hide"/> |
| 38 | </field> |
| 39 | </field> |
| 40 | </record> |
| 41 | |
| 42 | <record id="view_in_invoice_refund_tree_inherit" model="ir.ui.view"> |
| 43 | <field name="name">account.move.list.inherit</field> |
| 44 | <field name="model">account.move</field> |
| 45 | <field name="inherit_id" ref="account.view_in_invoice_refund_tree" /> |
| 46 | <field name="arch" type="xml"> |
| 47 | <field name="status_in_payment" position="before"> |
| 48 | <field name="edi_state" optional="hide"/> |
| 49 | <field name="edi_blocking_level" optional="hide"/> |
| 50 | <field name="edi_error_message" optional="hide"/> |
| 51 | </field> |
| 52 | </field> |
| 53 | </record> |
| 54 | |
| 55 | <record id="view_in_bill_tree_inherit" model="ir.ui.view"> |
| 56 | <field name="name">account.move.tree.inherit</field> |
| 57 | <field name="model">account.move</field> |
| 58 | <field name="inherit_id" ref="account.view_in_invoice_bill_tree" /> |
| 59 | <field name="arch" type="xml"> |
| 60 | <field name="status_in_payment" position="before"> |
| 61 | <field name="edi_state" optional="hide"/> |
| 62 | <field name="edi_blocking_level" optional="hide"/> |
| 63 | <field name="edi_error_message" optional="hide"/> |
| 64 | </field> |
| 65 | </field> |
| 66 | </record> |
| 67 | |
| 68 | <record id="view_account_invoice_filter" model="ir.ui.view"> |
| 69 | <field name="name">account.invoice.select.inherit</field> |
| 70 | <field name="model">account.move</field> |
| 71 | <field name="inherit_id" ref="account.view_account_invoice_filter"/> |
| 72 | <field name="arch" type="xml"> |
| 73 | <xpath expr="//search/group/filter[@name='status']" position="after"> |
| 74 | <filter string="Electronic invoicing state" name="edi_state" groups="base.group_no_one" |
| 75 | context="{'group_by': 'edi_state'}"/> |
| 76 | <separator/> |
| 77 | <filter string="Electronic invoicing processing needed" name="edi_to_process" groups="base.group_no_one" |
| 78 | domain="[('edi_state', 'in', [('to_send'), ('to_cancel')])]"/> |
| 79 | </xpath> |
| 80 | </field> |
| 81 | </record> |
| 82 | |
| 83 | <record id="view_move_form_inherit" model="ir.ui.view"> |
| 84 | <field name="name">account.move.form.inherit</field> |
| 85 | <field name="model">account.move</field> |
| 86 | <field name="inherit_id" ref="account.view_move_form" /> |
| 87 | <field name="arch" type="xml"> |
| 88 | <xpath expr="//button[@name='button_cancel']" position="after"> |
| 89 | <field name="edi_show_cancel_button" invisible="1"/> |
| 90 | <field name="edi_show_abandon_cancel_button" invisible="1"/> |
| 91 | <field name="edi_show_force_cancel_button" invisible="1"/> |
| 92 | <button name="button_cancel_posted_moves" |
| 93 | string="Request EDI Cancellation" |
| 94 | type="object" |
| 95 | groups="account.group_account_invoice" |
| 96 | invisible="not edi_show_cancel_button" |
| 97 | data-hotkey="x"/> |
| 98 | <button name="button_abandon_cancel_posted_posted_moves" |
| 99 | string="Call off EDI Cancellation" |
| 100 | type="object" |
| 101 | groups="account.group_account_invoice" |
| 102 | invisible="not edi_show_abandon_cancel_button"/> |
| 103 | </xpath> |
| 104 | <xpath expr="//header" position="after"> |
| 105 | <field name="edi_blocking_level" invisible="1" /> |
| 106 | <field name="edi_error_count" invisible="1" /> |
| 107 | <div class="alert alert-info d-flex justify-content-between align-items-center" role="alert" |
| 108 | invisible="edi_web_services_to_process in ['', False] or state == 'draft'"> |
| 109 | <div>The invoice will soon be sent to |
| 110 | <field name="edi_web_services_to_process" class="w-auto"/> |
| 111 | </div> |
| 112 | <button name="button_process_edi_web_services" type="object" class="oe_link py-0 text-decoration-underline" string="Process now"/> |
| 113 | </div> |
| 114 | <div class="alert alert-danger" role="alert" |
| 115 | invisible="edi_error_count == 0 or edi_blocking_level != 'error'"> |
| 116 | <div class="o_row align-items-center"> |
| 117 | <field name="edi_error_message" /> |
| 118 | <button name="button_force_cancel" |
| 119 | string="Force Cancel" |
| 120 | type="object" |
| 121 | groups="account.group_account_invoice" |
| 122 | confirm="Are you sure you want to cancel this invoice without waiting for the EDI document to be canceled?" |
| 123 | invisible="not edi_show_force_cancel_button" /> |
| 124 | <button name="%(account_edi.action_open_edi_documents)d" string="⇒ See errors" type="action" class="oe_link" invisible="edi_error_count == 1" /> |
| 125 | <button name="action_retry_edi_documents_error" type="object" class="oe_link oe_inline" string="Retry" /> |
| 126 | </div> |
| 127 | </div> |
| 128 | <div class="alert alert-warning" role="alert" |
| 129 | invisible="edi_error_count == 0 or edi_blocking_level != 'warning'"> |
| 130 | <div class="o_row"> |
| 131 | <field name="edi_error_message" /> |
| 132 | <button name="%(account_edi.action_open_edi_documents)d" string="⇒ See errors" type="action" class="oe_link" invisible="edi_error_count == 1" /> |
| 133 | </div> |
| 134 | </div> |
| 135 | <div class="alert alert-info" role="alert" |
| 136 | invisible="edi_error_count == 0 or edi_blocking_level != 'info'"> |
| 137 | <div class="o_row"> |
| 138 | <field name="edi_error_message" /> |
| 139 | <button name="%(account_edi.action_open_edi_documents)d" string="⇒ See errors" type="action" class="oe_link" invisible="edi_error_count == 1" /> |
| 140 | </div> |
| 141 | </div> |
| 142 | </xpath> |
| 143 | <xpath expr="//div[@name='journal_div']" position="after"> |
| 144 | <field name="edi_state" invisible="not edi_state or state == 'draft'"/> |
| 145 | </xpath> |
| 146 | <xpath expr="//page[@id='other_tab']" position="after"> |
| 147 | <page id="edi_documents" |
| 148 | string="EDI Documents" |
| 149 | name="page_edi_documents" |
| 150 | groups="base.group_no_one" |
| 151 | invisible="not edi_document_ids"> |
| 152 | <field name="edi_document_ids"> |
| 153 | <list create="false" delete="false" edit="false" decoration-danger="error" no_open="1"> |
| 154 | <field name="name"/> |
| 155 | <field name="edi_format_name"/> |
| 156 | <field name="state"/> |
| 157 | <field name="error" column_invisible="True"/> |
| 158 | <field name="blocking_level" column_invisible="True"/> |
| 159 | <button name="action_export_xml" |
| 160 | type="object" |
| 161 | class="oe_link oe_inline" |
| 162 | string="Download" |
| 163 | groups="base.group_no_one" |
| 164 | invisible="not error or blocking_level == 'info'"/> |
| 165 | </list> |
| 166 | </field> |
| 167 | </page> |
| 168 | </xpath> |
| 169 | </field> |
| 170 | </record> |
| 171 | </data> |
| 172 | </odoo> |