Debian Codegraph @

addons/l10n_latam_invoice_document/views/account_move_view.xml

raw
1 <?xml version="1.0" encoding="utf-8"?>
2 <odoo>
3
4 <record id="view_account_invoice_filter" model="ir.ui.view">
5 <field name="name">account.move.select</field>
6 <field name="model">account.move</field>
7 <field name="inherit_id" ref="account.view_account_invoice_filter"/>
8 <field name="arch" type="xml">
9 <field name="partner_id" position="after">
10 <field name="l10n_latam_document_type_id"/>
11 </field>
12 <group>
13 <filter string="Document Type" name="l10n_latam_document_type" domain="" context="{'group_by':'l10n_latam_document_type_id'}"/>
14 </group>
15 </field>
16 </record>
17
18 <record id="view_account_move_filter" model="ir.ui.view">
19 <field name="name">account.move.filter</field>
20 <field name="model">account.move</field>
21 <field name="inherit_id" ref="account.view_account_move_filter"/>
22 <field name="arch" type="xml">
23 <field name="partner_id" position="after">
24 <field name="l10n_latam_document_type_id"/>
25 </field>
26 <group>
27 <filter string="Document Type" name="l10n_latam_document_type" domain="" context="{'group_by':'l10n_latam_document_type_id'}"/>
28 </group>
29 </field>
30 </record>
31
32 <record id="view_move_form" model="ir.ui.view">
33 <field name="name">account.move.form</field>
34 <field name="model">account.move</field>
35 <field name="inherit_id" ref="account.view_move_form"/>
36 <field name="arch" type="xml">
37 <form>
38 <field name="l10n_latam_available_document_type_ids" invisible="1"/>
39 <field name="l10n_latam_use_documents" invisible="1"/>
40 <field name="l10n_latam_manual_document_number" invisible="1"/>
41 </form>
42
43 <xpath expr="//div[@name='journal_div']" position="after">
44 <field name="l10n_latam_document_type_id"
45 invisible="not l10n_latam_use_documents"
46 readonly="posted_before"
47 required="partner_id and l10n_latam_use_documents"
48 domain="[('id', 'in', l10n_latam_available_document_type_ids)]" options="{'no_open': True, 'no_create': True}"/>
49 <field name="l10n_latam_document_number"
50 invisible="(not l10n_latam_use_documents or not l10n_latam_manual_document_number) and (not l10n_latam_use_documents or highest_name or state != 'draft')"
51 readonly="posted_before and state != 'draft'"
52 required="partner_id and l10n_latam_use_documents and l10n_latam_manual_document_number"/>
53 </xpath>
54
55 <!-- on latam_documents we use document_number to set name -->
56 <field name="name" position="attributes">
57 <attribute name="readonly">state != 'draft' or l10n_latam_use_documents</attribute>
58 <attribute name="force_save">1</attribute>
59 </field>
60
61 </field>
62 </record>
63
64 </odoo>