| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<odoo> |
| 3 |
<record id="account_nilvera_view_move_form" model="ir.ui.view"> |
| 4 |
<field name="name">account.nilvera.view.move.form</field> |
| 5 |
<field name="model">account.move</field> |
| 6 |
<field name="inherit_id" ref="account.view_move_form"/> |
| 7 |
<field name="arch" type="xml"> |
| 8 |
<xpath expr="//header" position="after"> |
| 9 |
<div class="alert alert-info" role="alert" invisible="state != 'draft' or l10n_tr_nilvera_send_status != 'error' or not l10n_tr_nilvera_uuid"> |
| 10 |
To preserve accounting integrity and comply with legal requirements, invoices cannot be reused once an error occurs. Please create a new invoice to continue. |
| 11 |
</div> |
| 12 |
</xpath> |
| 13 |
<xpath expr="//button[@name='action_post'][2]" position="attributes"> |
| 14 |
<attribute name="invisible" separator=" or " add="l10n_tr_nilvera_send_status == 'error' and l10n_tr_nilvera_uuid"/> |
| 15 |
</xpath> |
| 16 |
<xpath expr="//div[@name='journal_div']" position="after"> |
| 17 |
<label for="l10n_tr_nilvera_send_status" invisible="country_code != 'TR' or state == 'draft' or move_type not in ['out_invoice', 'in_invoice']"/> |
| 18 |
<div name="nilvera_div" |
| 19 |
class="d-flex" |
| 20 |
invisible="country_code != 'TR' or state == 'draft' or move_type not in ['out_invoice', 'in_invoice']"> |
| 21 |
<field name="l10n_tr_nilvera_send_status" class="oe_inline"/> |
| 22 |
</div> |
| 23 |
</xpath> |
| 24 |
<xpath expr="//header/field[@name='state']" position="before"> |
| 25 |
<button name="l10n_tr_nilvera_get_pdf" |
| 26 |
string="Fetch Nilvera PDF" |
| 27 |
type="object" |
| 28 |
invisible="move_type != 'out_invoice' or l10n_tr_nilvera_send_status != 'succeed'"/> |
| 29 |
</xpath> |
| 30 |
</field> |
| 31 |
</record> |
| 32 |
|
| 33 |
<record id="account_nilvera_view_account_invoice_filter" model="ir.ui.view"> |
| 34 |
<field name="name">account.nilvera.invoice.select</field> |
| 35 |
<field name="model">account.move</field> |
| 36 |
<field name="inherit_id" ref="account.view_account_invoice_filter"/> |
| 37 |
<field name="arch" type="xml"> |
| 38 |
<xpath expr="//filter[@name='accounting_date']" position="after"> |
| 39 |
<filter string="Nilvera Status" name="nilvera_status" context="{'group_by': 'l10n_tr_nilvera_send_status'}"/> |
| 40 |
</xpath> |
| 41 |
</field> |
| 42 |
</record> |
| 43 |
|
| 44 |
<record id="account_nilvera_view_invoice_tree" model="ir.ui.view"> |
| 45 |
<field name="name">account.nilvera.invoice.list</field> |
| 46 |
<field name="model">account.move</field> |
| 47 |
<field name="inherit_id" ref="account.view_invoice_tree"/> |
| 48 |
<field name="arch" type="xml"> |
| 49 |
<button name="action_force_register_payment" position="after"> |
| 50 |
<button name="l10n_tr_nilvera_get_pdf" type="object" string="Fetch Nilvera PDF"/> |
| 51 |
</button> |
| 52 |
<xpath expr="//field[@name='abnormal_date_warning']" position="after"> |
| 53 |
<field name="l10n_tr_nilvera_send_status" |
| 54 |
string="Nilvera Status" |
| 55 |
widget="badge" |
| 56 |
decoration-danger="l10n_tr_nilvera_send_status == 'error'" |
| 57 |
decoration-warning="l10n_tr_nilvera_send_status in ('sent', 'waiting')" |
| 58 |
decoration-success="l10n_tr_nilvera_send_status == 'succeed'" |
| 59 |
optional="hide"/> |
| 60 |
</xpath> |
| 61 |
</field> |
| 62 |
</record> |
| 63 |
</odoo> |