Files
jikimo_sf/sf_sale/views/purchase_order_view.xml
2024-03-14 15:45:40 +08:00

196 lines
13 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 name="check_status" invisible="1"/>
</field>
<field name="currency_id" position="after">
<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','fail']),('state', 'in', ['purchase','draft'])]}"
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"
groups="sf_base.group_purchase,sf_base.group_purchase_director"
attrs="{'invisible': ['|','&amp;','&amp;', ('state', 'in', ['purchase','draft']), ('check_status', 'in', ['approved']), ('date_approve', '!=', False),'&amp;', '&amp;',('state', 'in', ['purchase', 'draft']),('check_status', 'in', [False, 'pending', 'fail']),('date_approve', '=', False)]}"
/>
<button name="button_confirming" type="object"
string="确认订单" groups="sf_base.group_purchase,sf_base.group_purchase_director"
attrs="{'invisible': ['&amp;',('check_status','!=', False),('state', 'not in', ['draft','send'])]}"
/>
</xpath>
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="replace">
<button name="action_rfq_send" states="draft" string="通过Email发送采购单" type="object"
context="{'send_rfq':True}" class="oe_highlight" data-hotkey="g"
groups="sf_base.group_purchase,sf_base.group_purchase_director"/>
</xpath>
<xpath expr="//form/header/button[@name='action_rfq_send'][2]" position="replace">
<button name="action_rfq_send" states="sent" string="通过Email重新发送采购单" type="object"
context="{'send_rfq':True}" data-hotkey="g"
groups="sf_base.group_purchase,sf_base.group_purchase_director"/>
</xpath>
<xpath expr="//form/header/button[@name='action_rfq_send'][3]" position="replace">
<button name="action_rfq_send" states="purchase" string="通过Email发送订单" type="object"
context="{'send_rfq':False}" data-hotkey="g"
groups="sf_base.group_purchase,sf_base.group_purchase_director"/>
</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']" position="replace">
<!-- <attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute> -->
<button name="action_create_invoice" string="创建账单" type="object" class="oe_highlight"
context="{'create_bill':True}"
attrs="{'invisible': ['|', ('state', 'not in', ('purchase', 'done')), ('invoice_status', 'in', ('no', 'invoiced'))]}"
data-hotkey="w" groups="sf_base.group_purchase,sf_base.group_purchase_director"/>
</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='button_confirm']" position="attributes">
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
<!-- <button name="action_create_invoice" string="创建账单" type="object" class="oe_highlight" context="{'create_bill':True}" attrs="{'invisible': ['|', ('state', 'not in', ('purchase', 'done')), ('invoice_status', 'in', ('no', 'invoiced'))]}" data-hotkey="w" groups="sf_base.group_purchase,sf_base.group_purchase_director"/> -->
</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_order_kpis_tree_inherit_sf" model="ir.ui.view">
<field name="name">purchase.stock.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">
<xpath expr="//tree//header//button[@name='action_create_invoice']" position="attributes">
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
</xpath>
</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_view_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_view_tree"/>
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="default_order">check_status desc,date_approve asc</attribute>
</tree>
<field name="amount_total" 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>
<record id="purchase_order_search_inherit_sf" model="ir.ui.view">
<field name="name">purchase.order.list.select.inherit.sf</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="replace">
<field name="name" string="单据编码" filter_domain="[('name', 'ilike', self)]"/>
</xpath>
</field>
</record>
</data>
</odoo>