Files
test/sf_sale/views/purchase_order_view.xml
2024-01-02 17:42:06 +08:00

146 lines
9.1 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<record model="ir.ui.view" id="view_purchase_order_form_inherit_sf">
<field name="name">purchase.order.form.inherit.sf</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="partner_id" widget="res_partner_many2one" context="{'is_supplier': True }"/>
</field>
<field name="currency_id" position="after">
<field name="check_status" invisible="1"/>
<!-- <field name="state"/>-->
<field name="remark" attrs="{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['pending','approved'])]}"/>
</field>
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="after">
<button name="sf_sale.action_purchase_order_check_wizard" string="审核" type="action"
context="{'default_order_id':active_id}" groups="sf_base.group_purchase_director"
attrs="{'invisible': ['&amp;',('check_status','in', ['approved']),('state', 'in', ['draft','send','purchase'])]}"
class="oe_highlight"/>
</xpath>
<xpath expr="//form/header/button[@name='button_confirm'][2]" position="replace">
<button name="button_confirm" type="object" context="{'validate_analytic': True}"
string="确认订单" id="draft_confirm"
attrs="{'invisible': ['|','&amp;',('check_status','in', ['approved','fail','pending']),('state', 'in', ['draft','purchase']),('state', 'in', ['purchase'])]}"
/>
</xpath>
<!-- <xpath expr="//form/header/button[@name='action_rfq_send[1]']" position="attributes">-->
<!-- <attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>-->
<!-- </xpath>-->
<!-- <xpath expr="//form/header/button[@name='action_rfq_send[2]']" position="attributes">-->
<!-- <attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>-->
<!-- </xpath>-->
<!-- <xpath expr="//form/header/button[@name='print_quotation[1]']" position="attributes">-->
<!-- <attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>-->
<!-- </xpath>-->
<!-- <xpath expr="//form/header/button[@name='print_quotation[2]']" position="attributes">-->
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
<!-- </xpath>-->
<xpath expr="//form/header/button[@name='button_approve']" position="attributes">
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
</xpath>
<!-- <xpath expr="//form/header/button[@name='action_create_invoice[1]']" position="attributes">-->
<!-- <attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>-->
<!-- </xpath>-->
<!-- <xpath expr="//form/header/button[@name='action_create_invoice[2]']" position="attributes">-->
<!-- <attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>-->
<!-- </xpath>-->
<xpath expr="//form/header/button[@name='confirm_reminder_mail']" position="attributes">
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
</xpath>
<xpath expr="//form/header/button[@name='button_draft']" position="attributes">
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
</xpath>
<xpath expr="//form/header/button[@name='button_cancel']" position="attributes">
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
</xpath>
<xpath expr="//form/header/button[@name='button_unlock']" position="attributes">
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
</xpath>
<xpath expr="//form/header/button[@name='button_done']" position="attributes">
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
</xpath>
<xpath expr="//field[@name='order_line']" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['pending','approved'])]}
</attribute>
</xpath>
<field name="partner_ref" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['pending','approved'])]}
</attribute>
</field>
<field name="date_planned" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['pending','approved'])]}
</attribute>
</field>
<field name="receipt_reminder_email" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['pending','approved'])]}
</attribute>
</field>
<field name="user_id" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['pending','approved'])]}
</attribute>
</field>
<field name="origin" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['pending','approved'])]}
</attribute>
</field>
<field name="payment_term_id" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['pending','approved'])]}
</attribute>
</field>
<field name="fiscal_position_id" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['pending','approved'])]}
</attribute>
</field>
</field>
</record>
<record id="purchase_stock_order_view_form_inherit_sf" model="ir.ui.view">
<field name="name">purchase.stock.order.form.inherit.sf</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase_stock.purchase_order_view_form_inherit"/>
<field name="arch" type="xml">
<field name="incoterm_id" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['pending','approved'])]}
</attribute>
</field>
<field name="incoterm_location" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['pending','approved'])]}
</attribute>
</field>
</field>
</record>
<record id="view_purchase_order_kpis_tree_inherit_sf" model="ir.ui.view">
<field name="name">purchase.order.tree.inherit.sf</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_kpis_tree"/>
<field name="arch" type="xml">
<field name="state" position="after">
<field name="check_status" widget="badge"
decoration-success="check_status == 'approved'"
decoration-warning="check_status == 'pending'"
decoration-danger="check_status == 'fail'"/>
</field>
</field>
</record>
</data>
</odoo>