| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<odoo> |
| 3 |
<record id="view_move_form_inherit_l10n_my_myinvois" model="ir.ui.view"> |
| 4 |
<field name="name">account.move.form.inherit.l10n_my_myinvois</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="//div[@name='button_box']" position="inside"> |
| 9 |
<field name="l10n_my_edi_document_ids" invisible="1"/> |
| 10 |
<button name="action_show_myinvois_documents" type="object" class="oe_stat_button" icon="fa-file-text-o" invisible="not l10n_my_edi_document_ids"> |
| 11 |
<div class="o_field_widget o_stat_info"> |
| 12 |
<span class="o_stat_text">MyInvois<br/>Documents</span> |
| 13 |
</div> |
| 14 |
</button> |
| 15 |
</xpath> |
| 16 |
<xpath expr="//widget[@name='web_ribbon']" position="before"> |
| 17 |
<widget name="web_ribbon" title="Processing" bg_color="text-bg-info" invisible="l10n_my_edi_state != 'in_progress'"/> |
| 18 |
<widget name="web_ribbon" title="Rejected" bg_color="text-bg-warning" invisible="l10n_my_edi_state != 'rejected'"/> |
| 19 |
</xpath> |
| 20 |
<!-- We want the CTA to be primary only on invoices, and secondary on vendor bills. --> |
| 21 |
<button name="action_invoice_sent" position="before"> |
| 22 |
<button name="action_l10n_my_edi_send_invoice" string="Send To MyInvois" type="object" |
| 23 |
groups="account.group_account_invoice" |
| 24 |
class="oe_highlight" |
| 25 |
invisible="not l10n_my_invoice_need_edi or l10n_my_edi_state or move_type not in ('out_invoice', 'out_refund')"/> |
| 26 |
</button> |
| 27 |
<button name="action_register_payment" position="after"> |
| 28 |
<button name="action_l10n_my_edi_send_invoice" string="Send To MyInvois" type="object" |
| 29 |
groups="account.group_account_invoice" |
| 30 |
invisible="not l10n_my_invoice_need_edi or l10n_my_edi_state or move_type not in ('in_invoice', 'in_refund')"/> |
| 31 |
</button> |
| 32 |
<xpath expr="//header" position="inside"> |
| 33 |
<!-- The invalid/cancelled states should be final. --> |
| 34 |
<!-- This button is not needed on rejected invoices as it expects an action from the user --> |
| 35 |
<button name="action_l10n_my_edi_update_status" string="Update MyInvois Status" type="object" |
| 36 |
groups="account.group_account_invoice" |
| 37 |
invisible="not l10n_my_edi_state or (l10n_my_edi_state not in ['in_progress', 'valid']) or (l10n_my_edi_state == 'rejected' and move_type not in ('out_invoice', 'out_refund'))"/> |
| 38 |
</xpath> |
| 39 |
<!-- Add the classification code to the invoice lines --> |
| 40 |
<xpath expr="//field[@name='invoice_line_ids']/list/field[@name='name']" position="after"> |
| 41 |
<field name="l10n_my_edi_classification_code" optional="hide"/> |
| 42 |
</xpath> |
| 43 |
<!-- There are quite a few fields, and with other modules adding some too it would be too messy to not put them in a tab. --> |
| 44 |
<xpath expr="//notebook" position="inside"> |
| 45 |
<page string="MyInvois" invisible="country_code != 'MY' or move_type not in ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt')"> |
| 46 |
<group> |
| 47 |
<group> |
| 48 |
<!-- Only displayed if the invoice contains a tax of type Exempt --> |
| 49 |
<field name="l10n_my_edi_state" invisible="not l10n_my_edi_state"/> |
| 50 |
<field name="l10n_my_edi_exemption_reason" invisible="not l10n_my_edi_display_tax_exemption_reason" readonly="l10n_my_edi_state != False"/> |
| 51 |
<field name="l10n_my_edi_custom_form_reference" readonly="l10n_my_edi_state != False"/> |
| 52 |
</group> |
| 53 |
</group> |
| 54 |
</page> |
| 55 |
</xpath> |
| 56 |
</field> |
| 57 |
</record> |
| 58 |
|
| 59 |
<record id="view_invoice_list_inherit_l10n_my_myinvois" model="ir.ui.view"> |
| 60 |
<field name="name">account.move.list.inherit.l10n_my_myinvois</field> |
| 61 |
<field name="model">account.move</field> |
| 62 |
<field name="inherit_id" ref="account.view_invoice_tree" /> |
| 63 |
<field name="arch" type="xml"> |
| 64 |
<field name="status_in_payment" position="before"> |
| 65 |
<field name="l10n_my_edi_state" optional="hide"/> |
| 66 |
</field> |
| 67 |
</field> |
| 68 |
</record> |
| 69 |
|
| 70 |
<record id="invoice_send_to_myinvois" model="ir.actions.server"> |
| 71 |
<field name="name">Send To MyInvois</field> |
| 72 |
<field name="state">code</field> |
| 73 |
<field name="model_id" ref="model_account_move"/> |
| 74 |
<field name="binding_model_id" ref="model_account_move"/> |
| 75 |
<field name="binding_view_types">list,kanban</field> |
| 76 |
<field name="code"> |
| 77 |
if records: |
| 78 |
action = records.action_l10n_my_edi_send_invoice() |
| 79 |
</field> |
| 80 |
</record> |
| 81 |
</odoo> |