Files
odoo_source/addons/purchase_requisition/views/purchase_views.xml
T
niyasraphy 8ae9212b15 [FIX] purchase_requisition: show button without clicking save button
install purchase_requisition module, and create an RFQ in db, check the alternatives tab in the notebook, currently the button Create Alternatives will not be visible unless user click the save button manually. button no longer needs to be hidden when creating a new PO since v16 added in the auto-save feature

closes odoo/odoo#107733

X-original-commit: a6a830e89c724f993b930442573d8d0c4e692b07
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-12-12 15:17:23 +01:00

121 lines
6.8 KiB
XML

<?xml version="1.0"?>
<odoo>
<record id="purchase_order_form_inherit" model="ir.ui.view">
<field name="name">purchase.order.form.inherit</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<field name="partner_id" position="replace">
<field name="is_quantity_copy" invisible="1"/>
<field name="partner_id" widget="res_partner_many2one" context="{'res_partner_search_mode': 'supplier', 'show_vat': True}" attrs="{'readonly': ['|', ('is_quantity_copy', '=', 'none'), ('state', 'in', ['purchase', 'done', 'cancel'])]}" placeholder="Name, TIN, Email, or Reference" force_save="1"/>
</field>
<field name="partner_ref" position="after">
<field name="requisition_id" domain="[('state', 'in', ('in_progress', 'open', 'ongoing')), ('vendor_id', 'in', (partner_id, False)), ('company_id', '=', company_id)]"/>
</field>
<xpath expr="//page[@name='purchase_delivery_invoice']" position="after">
<page string="Alternatives" name="alternative_pos">
<group>
<group>
<p colspan="2">Create a call for tender by adding alternative request for quotations to different vendors.
Make your choice by selecting the best combination of lead time, OTD and/or total amount.
By comparing product lines you can also decide to order some products from one vendor and others from another vendor.</p>
</group>
<group>
<p colspan="2">
<button name="action_create_alternative" type="object" class="btn-link d-block" string="Create Alternative" icon="fa-copy"/>
<button name="action_compare_alternative_lines" type="object" class="btn-link d-block" string="Compare Product Lines" icon="fa-bar-chart" attrs="{'invisible': [('alternative_po_ids', '=', [])]}"/>
</p>
</group>
</group>
<field name="alternative_po_ids" attrs="{'readonly': [('id', '=', False)]}" widget="many2many_alt_pos" context="{'quotation_only': True}">
<tree string="Alternative Purchase Order" decoration-muted="state in ['cancel', 'purchase', 'done']" decoration-bf="id == parent.id">
<control>
<create string="Link to Existing RfQ"/>
</control>
<field name="partner_id"/>
<field name="name" string="Reference"/>
<field name="date_planned"/>
<field name="amount_total"/>
<field name="state"/>
</tree>
</field>
</page>
</xpath>
</field>
</record>
<record id="purchase_order_search_inherit" model="ir.ui.view">
<field name="name">purchase.order.list.select.inherit</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='approved']" position="after">
<filter string="Requisition" name="requisition" domain="[('requisition_id', '!=', False)]" help="Purchase Orders with requisition"/>
</xpath>
</field>
</record>
<record id="purchase_order_kpis_tree_inherit_purchase_requisition" model="ir.ui.view">
<field name="name">purchase.order.kpis.tree.inherit.purchase.requisition</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_kpis_tree"/>
<field name="arch" type="xml">
<field name="name" position="before">
<field name="has_alternatives" invisible="1"/>
<button class="fa fa-copy"
title="Has Alternatives"
disabled="1"
attrs="{'invisible': [('has_alternatives', '=', False)]}"/>
</field>
</field>
</record>
<record id="purchase_order_tree_inherit_purchase_requisition" model="ir.ui.view">
<field name="name">purchase.order.tree.inherit.purchase.requisition</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_tree"/>
<field name="arch" type="xml">
<field name="name" position="before">
<field name="has_alternatives" invisible="1"/>
<button class="fa fa-copy"
title="Has Alternatives"
disabled="1"
attrs="{'invisible': [('has_alternatives', '=', False)]}"/>
</field>
</field>
</record>
<record id="purchase_order_line_compare_tree" model="ir.ui.view">
<field name="name">purchase.order.line.compare.tree</field>
<field name="model">purchase.order.line</field>
<field name="priority">1000</field>
<field name="arch" type="xml">
<tree string="Purchase Order Lines"
decoration-muted="state in ['cancel', 'purchase', 'done']"
create="0" delete="0" edit="0" expand="1"
js_class="purchase_order_line_compare">
<header>
<button name="action_clear_quantities" string="Clear Selected" type="object" class="o_clear_qty_buttons"/>
</header>
<field name="product_id" readonly="1"/>
<field name="partner_id" string="Vendor"/>
<field name="order_id" string="Reference" readonly="1"/>
<field name="state"/>
<field name="name" readonly="1"/>
<field name="date_planned" readonly="1"/>
<field name="product_qty"/>
<field name="product_uom" groups="uom.group_uom"/>
<field name="price_unit"/>
<field name="price_subtotal" string="Total"/>
<field name="currency_id"/>
<button name="action_choose" string="Choose" type="object" class="o_clear_qty_buttons" icon="fa-bullseye"
attrs="{'invisible': [('product_qty', '&lt;=', 0.0)]}"/>
<button name="action_clear_quantities" string="Clear" type="object" class="o_clear_qty_buttons" icon="fa-times"
attrs="{'invisible': ['|', ('product_qty', '&lt;=', 0.0), ('state', 'in', ['cancel', 'purchase', 'done'])]}"/>
</tree>
</field>
</record>
</odoo>