| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<odoo> |
| 3 |
|
| 4 |
<record id="account_move_form_inherit_l10n_gr_edi" model="ir.ui.view"> |
| 5 |
<field name="name">account.move.form.inherit.l10n_gr_edi</field> |
| 6 |
<field name="model">account.move</field> |
| 7 |
<field name="inherit_id" ref="account.view_move_form"/> |
| 8 |
<field name="arch" type="xml"> |
| 9 |
|
| 10 |
<header position="inside"> |
| 11 |
<button name="l10n_gr_edi_try_send_expense_classification" |
| 12 |
type="object" |
| 13 |
string="Send Expense Classifications to myDATA" |
| 14 |
invisible="not l10n_gr_edi_enable_send_expense_classification"/> |
| 15 |
</header> |
| 16 |
|
| 17 |
<header position="after"> |
| 18 |
<div class="m-0" role="alert" invisible="not (l10n_gr_edi_enable_send_invoices and l10n_gr_edi_alerts)"> |
| 19 |
<field name="l10n_gr_edi_alerts" class="o_field_html" widget="actionable_errors"/> |
| 20 |
</div> |
| 21 |
</header> |
| 22 |
|
| 23 |
<xpath expr="//group[@id='header_right_group']" position="inside"> |
| 24 |
<field name="l10n_gr_edi_available_inv_type" invisible="1"/> |
| 25 |
<field name="l10n_gr_edi_inv_type" |
| 26 |
string="Invoice Type" |
| 27 |
widget="dynamic_selection" |
| 28 |
options="{'available_field': 'l10n_gr_edi_available_inv_type'}" |
| 29 |
invisible="not l10n_gr_edi_enable_view_mydata" |
| 30 |
required="1" |
| 31 |
readonly="state != 'draft'"/> |
| 32 |
<field name="l10n_gr_edi_correlation_id" |
| 33 |
invisible="not (l10n_gr_edi_enable_view_mydata and l10n_gr_edi_need_correlated)" |
| 34 |
required="l10n_gr_edi_need_correlated" |
| 35 |
readonly="state != 'draft'"/> |
| 36 |
<field name="l10n_gr_edi_payment_method" |
| 37 |
invisible="not (l10n_gr_edi_enable_view_mydata and l10n_gr_edi_need_payment_method)" |
| 38 |
required="l10n_gr_edi_need_payment_method" |
| 39 |
readonly="state != 'draft'"/> |
| 40 |
<!--The myDATA Mark field will have the following behaviors: |
| 41 |
* only appear in greece invoices/bills |
| 42 |
* always visible on bills, and only visible on invoices when filled |
| 43 |
* editable only on draft bills --> |
| 44 |
<field name="l10n_gr_edi_mark" |
| 45 |
invisible="not (l10n_gr_edi_enable_view_mydata and (l10n_gr_edi_mark or move_type in ('in_invoice', 'in_refund', 'in_receipt')))" |
| 46 |
readonly="not (state == 'draft' and move_type in ('in_invoice', 'in_refund'))"/> |
| 47 |
<field name="l10n_gr_edi_cls_mark" |
| 48 |
invisible="not (l10n_gr_edi_enable_view_mydata and l10n_gr_edi_cls_mark)" |
| 49 |
readonly="1"/> |
| 50 |
<field name="l10n_gr_edi_state" |
| 51 |
invisible="not (l10n_gr_edi_enable_view_mydata and l10n_gr_edi_state)" |
| 52 |
readonly="1"/> |
| 53 |
</xpath> |
| 54 |
|
| 55 |
<xpath expr="//notebook/page[@name='invoice_tab']//list/field[@name='name']" position="after"> |
| 56 |
<field name="l10n_gr_edi_available_cls_category" column_invisible="1"/> |
| 57 |
<field name="l10n_gr_edi_available_cls_type" column_invisible="1"/> |
| 58 |
<field name="l10n_gr_edi_available_cls_vat" column_invisible="1"/> |
| 59 |
<field name="l10n_gr_edi_detail_type" optional="hide" column_invisible="parent.country_code != 'GR'"/> |
| 60 |
<field name="l10n_gr_edi_cls_category" |
| 61 |
widget="dynamic_selection" |
| 62 |
options="{'available_field': 'l10n_gr_edi_available_cls_category'}" |
| 63 |
optional="show" |
| 64 |
column_invisible="parent.country_code != 'GR'"/> |
| 65 |
<field name="l10n_gr_edi_cls_type" |
| 66 |
widget="dynamic_selection" |
| 67 |
options="{'available_field': 'l10n_gr_edi_available_cls_type'}" |
| 68 |
optional="show" |
| 69 |
column_invisible="parent.country_code != 'GR'"/> |
| 70 |
<field name="l10n_gr_edi_cls_vat" |
| 71 |
widget="dynamic_selection" |
| 72 |
options="{'available_field': 'l10n_gr_edi_available_cls_vat'}" |
| 73 |
optional="hide" |
| 74 |
column_invisible="parent.country_code != 'GR'"/> |
| 75 |
</xpath> |
| 76 |
|
| 77 |
<xpath expr="//notebook/page[@name='invoice_tab']//list/field[@name='tax_ids']" position="after"> |
| 78 |
<field name="l10n_gr_edi_need_exemption_category" column_invisible="True"/> |
| 79 |
<field name="l10n_gr_edi_tax_exemption_category" |
| 80 |
optional="hide" |
| 81 |
column_invisible="parent.country_code != 'GR'" |
| 82 |
readonly="not l10n_gr_edi_need_exemption_category"/> |
| 83 |
</xpath> |
| 84 |
|
| 85 |
<!-- myDATA Documents Tab --> |
| 86 |
<xpath expr="//page[@id='other_tab_entry']" position="after"> |
| 87 |
<page id="l10n_gr_edi_documents" |
| 88 |
string="myDATA" |
| 89 |
invisible="not l10n_gr_edi_document_ids"> |
| 90 |
<field name="l10n_gr_edi_document_ids"> |
| 91 |
<list create="false" delete="false" edit="false" no_open="1" |
| 92 |
decoration-danger="state in ('invoice_error', 'bill_error')" |
| 93 |
decoration-success="state in ('invoice_sent', 'bill_sent')"> |
| 94 |
<field name="message" column_invisible="1"/> |
| 95 |
<field name="attachment_id" column_invisible="1"/> |
| 96 |
<field name="datetime"/> |
| 97 |
<field name="state" widget="account_document_state"/> |
| 98 |
<button name="action_download" |
| 99 |
type="object" |
| 100 |
string="Download" |
| 101 |
invisible="not attachment_id"/> |
| 102 |
</list> |
| 103 |
</field> |
| 104 |
</page> |
| 105 |
</xpath> |
| 106 |
|
| 107 |
</field> |
| 108 |
</record> |
| 109 |
|
| 110 |
<record id="view_out_invoice_tree_inherit_l10n_gr_edi" model="ir.ui.view"> |
| 111 |
<field name="name">account.out.invoice.list.inherit.l10n_gr_edi</field> |
| 112 |
<field name="model">account.move</field> |
| 113 |
<field name="inherit_id" ref="account.view_out_invoice_tree"/> |
| 114 |
<field name="arch" type="xml"> |
| 115 |
<field name="status_in_payment" position="before"> |
| 116 |
<field name="l10n_gr_edi_state" optional="hide"/> |
| 117 |
</field> |
| 118 |
</field> |
| 119 |
</record> |
| 120 |
|
| 121 |
<record id="view_out_credit_note_tree_inherit_l10n_gr_edi" model="ir.ui.view"> |
| 122 |
<field name="name">account.out.credit.note.list.inherit.l10n_gr_edi</field> |
| 123 |
<field name="model">account.move</field> |
| 124 |
<field name="inherit_id" ref="account.view_out_credit_note_tree"/> |
| 125 |
<field name="arch" type="xml"> |
| 126 |
<field name="status_in_payment" position="before"> |
| 127 |
<field name="l10n_gr_edi_state" optional="hide"/> |
| 128 |
</field> |
| 129 |
</field> |
| 130 |
</record> |
| 131 |
|
| 132 |
<record id="view_in_invoice_bill_tree_inherit_l10n_gr_edi" model="ir.ui.view"> |
| 133 |
<field name="name">account.in.invoice.list.inherit.l10n_gr_edi</field> |
| 134 |
<field name="model">account.move</field> |
| 135 |
<field name="inherit_id" ref="account.view_in_invoice_tree"/> |
| 136 |
<field name="arch" type="xml"> |
| 137 |
<field name="status_in_payment" position="before"> |
| 138 |
<field name="l10n_gr_edi_state" optional="hide"/> |
| 139 |
</field> |
| 140 |
</field> |
| 141 |
</record> |
| 142 |
|
| 143 |
<record id="view_account_invoice_filter_inherit_l10n_gr_edi" model="ir.ui.view"> |
| 144 |
<field name="name">account.invoice.select.inherit.l10n_gr_edi</field> |
| 145 |
<field name="model">account.move</field> |
| 146 |
<field name="inherit_id" ref="account.view_account_invoice_filter"/> |
| 147 |
<field name="arch" type="xml"> |
| 148 |
<xpath expr="//search/field[@name='journal_id']" position="after"> |
| 149 |
<field name="l10n_gr_edi_state"/> |
| 150 |
</xpath> |
| 151 |
<xpath expr="//filter[@name='out_refund']" position="after"> |
| 152 |
<filter string="To send to myDATA" name="l10n_gr_edi_state_false" |
| 153 |
domain="[('l10n_gr_edi_state', 'in', (False, 'bill_fetched'))]"/> |
| 154 |
<filter string="Sent to myDATA" name="l10n_gr_edi_state_sent" |
| 155 |
domain="[('l10n_gr_edi_state', '=', 'invoice_sent')]"/> |
| 156 |
</xpath> |
| 157 |
<xpath expr="//group" position="inside"> |
| 158 |
<filter string="myDATA Status" name="l10n_gr_edi_state_group" |
| 159 |
domain="" context="{'group_by':'l10n_gr_edi_state'}"/> |
| 160 |
</xpath> |
| 161 |
</field> |
| 162 |
</record> |
| 163 |
|
| 164 |
<record id="l10n_gr_edi_action_try_send_batch" model="ir.actions.server"> |
| 165 |
<field name="name">Send to myDATA</field> |
| 166 |
<field name="model_id" ref="account.model_account_move"/> |
| 167 |
<field name="binding_model_id" ref="account.model_account_move"/> |
| 168 |
<field name="binding_view_types">list</field> |
| 169 |
<field name="state">code</field> |
| 170 |
<field name="code"> |
| 171 |
if records: |
| 172 |
records._l10n_gr_edi_try_send_batch() |
| 173 |
</field> |
| 174 |
</record> |
| 175 |
|
| 176 |
</odoo> |