summaryrefslogtreecommitdiff
path: root/addons/purchase/views/account_move_views.xml
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/purchase/views/account_move_views.xml
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/purchase/views/account_move_views.xml')
-rw-r--r--addons/purchase/views/account_move_views.xml38
1 files changed, 38 insertions, 0 deletions
diff --git a/addons/purchase/views/account_move_views.xml b/addons/purchase/views/account_move_views.xml
new file mode 100644
index 00000000..c24f8140
--- /dev/null
+++ b/addons/purchase/views/account_move_views.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="view_move_form_inherit_purchase" model="ir.ui.view">
+ <field name="name">account.move.inherit.purchase</field>
+ <field name="model">account.move</field>
+ <field name="inherit_id" ref="account.view_move_form"/>
+ <field name="groups_id" eval="[(4, ref('purchase.group_purchase_user'))]"/>
+ <field name="arch" type="xml">
+ <!-- Auto-complete could be done from either a bill either a purchase order -->
+ <field name="invoice_vendor_bill_id" position="after">
+ <field name="purchase_id" invisible="1"/>
+ <label for="purchase_vendor_bill_id" string="Auto-Complete" class="oe_edit_only"
+ attrs="{'invisible': ['|', ('state','!=','draft'), ('move_type', '!=', 'in_invoice')]}" />
+ <field name="purchase_vendor_bill_id" nolabel="1"
+ attrs="{'invisible': ['|', ('state','!=','draft'), ('move_type', '!=', 'in_invoice')]}"
+ class="oe_edit_only"
+ domain="partner_id and [('company_id', '=', company_id), ('partner_id','child_of', [partner_id])] or [('company_id', '=', company_id)]"
+ placeholder="Select a purchase order or an old bill"
+ context="{'show_total_amount': True}"
+ options="{'no_create': True, 'no_open': True}"/>
+ </field>
+ <label name="invoice_vendor_bill_id_label" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </label>
+ <field name="invoice_vendor_bill_id" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </field>
+ <!-- Add link to purchase_line_id to account.move.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>
+</odoo>