1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<record id="account_move_form_inherit" model="ir.ui.view">
<field name="name">Account Move</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<button name="action_post" position="after">
<button name="fixco_custom.action_view_invoice_reklas" string="Reklas"
type="action" class="btn-primary" attrs="{'invisible': ['|', ('state', '!=', 'posted'), ('move_type', 'not in', ['out_invoice', 'in_invoice'])]}"/>
</button>
<button name="open_reconcile_view" position="after">
<button type="object" name="action_view_related_payment"
class="oe_stat_button"
icon="fa-pencil-square-o"
attrs="{'invisible': [('move_type', '!=', 'in_invoice')]}">
<field name="count_payment" widget="statinfo" string="Payments"/>
</button>
</button>
<field name="payment_reference" position="after">
<field name="invoice_marketplace" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/>
<field name="faktur_pajak" readonly="1" attrs="{'invisible': [('move_type', '!=', 'in_invoice')]}"/>
<field name="transaction_type" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/>
</field>
<field name="partner_id" position="after">
<field name="address" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/>
</field>
<field name="invoice_date" position="after">
<field name="sale_id" readonly="1" attrs="{'invisible': [('move_type', 'not in', ('out_invoice','entry'))]}"/>
<field name="purchase_order_id" readonly="1" attrs="{'invisible': [('move_type', 'not in', ('in_invoice','entry'))]}"/>
<field name="picking_id" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/>
<field name="bill_id" readonly="1" attrs="{'invisible': [('move_type', '!=', 'in_invoice')]}"/>
</field>
<!-- ✅ Add the new Many2many field after invoice_vendor_bill_id -->
<field name="invoice_vendor_bill_id" position="after">
<field name="purchase_id" invisible="1"/>
<label for="purchase_vendor_bill_ids" string="Auto-Complete" class="oe_edit_only"
attrs="{'invisible': ['|', ('state','!=','draft'), ('move_type', '!=', 'in_invoice')]}" />
<field name="purchase_vendor_bill_ids" nolabel="1"
attrs="{'invisible': ['|', ('state','!=','draft'), ('move_type', '!=', 'in_invoice')]}"
domain="partner_id and [('company_id', '=', company_id), ('partner_id.commercial_partner_id', '=', commercial_partner_id)] or [('company_id', '=', company_id)]"
placeholder="Select purchase orders or past bills"
context="{'show_total_amount': True}"
options="{'no_create': True, 'no_open': True}"/>
</field>
<!-- Purchase line_id on invoice line -->
<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='company_id']" position="after">
<field name="purchase_line_id" invisible="1"/>
<field name="purchase_order_id"
attrs="{'column_invisible': [('parent.move_type', '!=', 'in_invoice')]}"
optional="hide"/>
</xpath>
<xpath expr="//field[@name='line_ids']/tree/field[@name='company_id']" position="after">
<field name="purchase_line_id" invisible="1"/>
</xpath>
</field>
</record>
<record id="account_move_inherit_purchase_inherit" model="ir.ui.view">
<field name="name">Account Move</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="purchase.view_move_form_inherit_purchase"/>
<field name="arch" type="xml">
<field name="purchase_line_id" position="attributes">
<attribute name="invisible">0</attribute>
<attribute name="optional">hide</attribute>
<attribute name="attrs">
{'column_invisible': [('parent.move_type', '!=', 'in_invoice')]}
</attribute>
</field>
<field name="quantity" position="after">
<field name="qty_outstanding" optional="hide"/>
</field>
</field>
</record>
</data>
</odoo>
|