| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<odoo> |
| 3 |
<data> |
| 4 |
<record id="myinvois_document_form_view" model="ir.ui.view"> |
| 5 |
<field name="name">myinvois.document.form.view</field> |
| 6 |
<field name="model">myinvois.document</field> |
| 7 |
<field name="arch" type="xml"> |
| 8 |
<form string="MyInvois Document" create="false"> |
| 9 |
<header> |
| 10 |
<button name="action_submit_to_myinvois" |
| 11 |
type="object" |
| 12 |
string="Submit To MyInvois" |
| 13 |
class="oe_highlight" |
| 14 |
invisible="myinvois_state and myinvois_state != 'invalid'"/> |
| 15 |
<button name="action_update_submission_status" |
| 16 |
type="object" |
| 17 |
string="Update Submission Status" |
| 18 |
class="oe_highlight" |
| 19 |
invisible="not myinvois_state or (myinvois_state not in ['in_progress', 'valid'])"/> |
| 20 |
<button name="action_cancel_submission" |
| 21 |
type="object" |
| 22 |
string="Cancel Submission" |
| 23 |
invisible="myinvois_state not in ['valid', 'rejected']"/> |
| 24 |
<field name="myinvois_state" widget="statusbar" statusbar_visible="in_progress,valid"/> |
| 25 |
</header> |
| 26 |
<sheet> |
| 27 |
<widget name="web_ribbon" title="Processing" bg_color="text-bg-info" invisible="myinvois_state != 'in_progress'"/> |
| 28 |
<widget name="web_ribbon" title="Rejected" bg_color="text-bg-warning" invisible="myinvois_state != 'rejected'"/> |
| 29 |
<div class="oe_button_box" name="button_box"/> <!-- Add the box to make it easier to add buttons in there when inheriting. --> |
| 30 |
<div class="oe_title"> |
| 31 |
<h1> |
| 32 |
<field name="display_name"/> |
| 33 |
</h1> |
| 34 |
</div> |
| 35 |
<group> |
| 36 |
<group> |
| 37 |
<field name="myinvois_issuance_date"/> |
| 38 |
<field name="myinvois_submission_uid"/> |
| 39 |
<field name="myinvois_external_uuid"/> |
| 40 |
<field name="myinvois_validation_time"/> |
| 41 |
<field name="myinvois_exemption_reason" invisible="not myinvois_exemption_reason" readonly="invoice_ids"/> |
| 42 |
<field name="myinvois_custom_form_reference" invisible="not myinvois_custom_form_reference" readonly="invoice_ids"/> |
| 43 |
</group> |
| 44 |
</group> |
| 45 |
</sheet> |
| 46 |
<chatter/> |
| 47 |
</form> |
| 48 |
</field> |
| 49 |
</record> |
| 50 |
|
| 51 |
<record id="myinvois_document_list_view" model="ir.ui.view"> |
| 52 |
<field name="name">myinvois.document.list.view</field> |
| 53 |
<field name="model">myinvois.document</field> |
| 54 |
<field name="arch" type="xml"> |
| 55 |
<list string="MyInvois Documents" create="false" sample="1" decoration-muted="myinvois_state == 'cancelled'"> |
| 56 |
<header> |
| 57 |
<button name="action_submit_to_myinvois" string="Submit To MyInvois" type="object" class="btn-primary"/> |
| 58 |
<button name="action_update_submission_status" string="Fetch Status From MyInvois" type="object"/> |
| 59 |
</header> |
| 60 |
<field name="display_name"/> |
| 61 |
<field name="myinvois_issuance_date"/> |
| 62 |
<field name="myinvois_state"/> |
| 63 |
</list> |
| 64 |
</field> |
| 65 |
</record> |
| 66 |
|
| 67 |
<record id="action_generate_myinvois_document_file" model="ir.actions.server"> |
| 68 |
<field name="name">Generate Document File</field> |
| 69 |
<field name="model_id" ref="l10n_my_edi.model_myinvois_document"/> |
| 70 |
<field name="binding_model_id" ref="l10n_my_edi.model_myinvois_document"/> |
| 71 |
<field name="binding_view_types">form</field> |
| 72 |
<field name="state">code</field> |
| 73 |
<field name="code">action = records.action_generate_xml_file()</field> |
| 74 |
</record> |
| 75 |
</data> |
| 76 |
</odoo> |