Files
jikimo_sf/sf_sale/views/sale_order_view.xml

250 lines
15 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<record id="sale_order_view_search_inherit_sf" model="ir.ui.view">
<field name="name">sale.order.search.inherit.sf</field>
<field name="model">sale.order</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="sale.view_sales_order_filter"/>
<field name="arch" type="xml">
<filter name="my_sale_orders_filter" position="replace">
<field name="campaign_id"/>
<separator/>
<filter string="报价" name="draft" domain="[('state','in',('draft', 'sent'))]"/>
<filter string="销售订单" name="sales" domain="[('state','in',('sale','done'))]"/>
<separator/>
<filter string="创建日期" name="filter_create_date" date="create_date"/>
</filter>
</field>
</record>
<record id="action_quotations_with_onboarding_inherit_sf" model="ir.actions.act_window">
<field name="name">报价</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_id" ref="sale.view_quotation_tree_with_onboarding"/>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
<field name="search_view_id" ref="sale_order_view_search_inherit_sf"/>
<field name="context">{'search_default_my_quotation': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new quotation, the first step of a new sale!
</p>
<p>
Once the quotation is confirmed by the customer, it becomes a sales order.
<br/>
You will be able to create an invoice and collect the payment.
</p>
</field>
</record>
<!-- <menuitem id="menu_sale_quotations">-->
<!-- <field name="active" eval="False"/>-->
<!-- </menuitem>-->
<menuitem id="menu_sale_quotations_inherit_sf"
action="action_quotations_with_onboarding_inherit_sf"
groups="sales_team.group_sale_salesman,sf_base.group_sale_salemanager,sf_base.group_sale_director"
parent="sale.sale_order_menu"
sequence="11"/>
<record model="ir.ui.view" id="view_sale_order_form_inherit_sf">
<field name="name">sale.order.form.inherit.sf</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='user_id']" position="replace">
<field name="user_id" widget="many2one_avatar_user" context="{'is_sale': True }"/>
</xpath>
<xpath expr="//form/header/button[@name='action_quotation_send'][1]" position="replace">
<button name="action_quotation_send" string="通过EMAIL发送" type="object"
class="btn-primary" data-hotkey="g" context="{'validate_analytic': True}"
attrs="{'invisible': ['|','&amp;',('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel']),'&amp;',('check_status', '=', 'approved'),('state', 'in', ['sale','cancel'])]}"/>
</xpath>
<xpath expr="//form/header/button[@name='action_confirm']" position="after">
<button name="submit" string="提交" type="object"
context="{'default_order_id':active_id}"
attrs="{'invisible': [('check_status','!=', False)]}"
class="oe_highlight"/>
</xpath>
<xpath expr="//form/header/button[@name='action_confirm']" position="after">
<field name="check_status" invisible="1"/>
<field name="schedule_status" invisible="1"/>
<button name="sf_sale.action_sale_order_check_wizard" string="审核" type="action"
context="{'default_order_id':active_id}" groups="sf_base.group_sale_director"
attrs="{'invisible': ['|',('check_status','in', ['approved',False]),('state', 'in', ['cancel'])]}"
class="oe_highlight"/>
</xpath>
<!-- <xpath expr="//form/header/button[@name='action_confirm'][1]" position="attributes">-->
<!-- <attribute name="attrs">{'invisible': [('check_status', '!=', 'approved'),('state', 'not in',-->
<!-- ['sent'])]}-->
<!-- </attribute>-->
<!-- </xpath>-->
<xpath expr="//form/header/button[@name='action_confirm'][2]" position="replace">
<button name="action_confirm" data-hotkey="v"
string="确认" type="object" context="{'validate_analytic': True}"
attrs="{'invisible': ['|','&amp;',('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel']),'&amp;',('check_status', '=', 'approved'),('state', 'in', ['sale','cancel'])]}"/>
</xpath>
<xpath expr="//form/header/button[@name='action_cancel']" position="attributes">
<attribute name="attrs">{'invisible': ['|',('state', 'in', ['cancel']),('check_status', 'in',
[False,'approved'])]}
</attribute>
</xpath>
<xpath expr="//form/header/button[@name='action_draft']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<!-- <xpath expr="//form/header/button[@name='action_draft']" position="replace">-->
<!-- <button name="action_draft" states="cancel" type="object" string="设为报价" data-hotkey="w"-->
<!-- invisible="1"/>-->
<!-- </xpath>-->
<field name="partner_id" position="replace">
<field name="partner_id" widget="res_partner_many2one" context="{'is_customer': True }"
options='{"always_reload": True}'/>
</field>
<field name="payment_term_id" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>
<field name="payment_term_id" position="after">
<field name="deadline_of_delivery" attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
<field name="payments_way" attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
<field name="pay_way" attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
<field name="schedule_status" readonly="1"/>
</field>
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="before">
<field name="model_glb_file" widget="Viewer3D" optional="show"
string="模型文件" attrs="{'readonly': [('state', 'in', ['draft'])]}"/>
</xpath>
<xpath expr="//field[@name='order_line']" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="replace">
<field name="name" widget="section_and_note_text" optional="show"
string="参数说明(长/宽/高/体积/精度/材质)"/>
</xpath>
<field name="user_id" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>
<field name="team_id" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>
<field name="fiscal_position_id" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>
<field name="client_order_ref" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>
<field name="tag_ids" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>
<field name="commitment_date" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>
<field name="origin" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>
<field name="campaign_id" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>
<field name="medium_id" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>
<field name="source_id" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>
<field name="signed_by" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>
<field name="signed_on" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>
<field name="signature" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>
</field>
</record>
<record model="ir.ui.view" id="view_sale_management_order_form_quote_inherit_sf">
<field name="name">sale.management.order.form.quote.inherit.sf</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale_management.sale_order_form_quote"/>
<field name="arch" type="xml">
<field name="date_order" position="attributes">
<attribute name="string">下单日期</attribute>
</field>
<field name="sale_order_template_id" position="after">
<field name="person_of_delivery" string="交货人"
attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
<field name="telephone_of_delivery" string="交货人联系方式"
attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
<field name="address_of_delivery" string="交货人地址"
attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
<field name="remark" attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
</field>
</field>
</record>
<record id="view_quotation_with_onboarding_tree_inherit_sf" model="ir.ui.view">
<field name="name">sale.order.quotation.tree.inherit.sf</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_quotation_tree_with_onboarding"/>
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="default_order">check_status desc,create_date asc</attribute>
<attribute name="delete">False</attribute>
</tree>
<field name="name" position="attributes">
<attribute name="string">订单号</attribute>
</field>
<field name="create_date" position="attributes">
<attribute name="string">下单时间</attribute>
</field>
<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>
<record id="view_order_tree_inherit_sf" model="ir.ui.view">
<field name="name">sale.order.tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree"/>
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="default_order">schedule_status desc,date_order asc</attribute>
<attribute name="create">False</attribute>
</tree>
<field name="name" position="attributes">
<attribute name="string">订单号</attribute>
</field>
<field name="amount_total" position="after">
<field name="schedule_status" widget="badge"
decoration-success="schedule_status == 'received'"
decoration-warning="schedule_status == 'to process'"
decoration-danger="schedule_status == 'to receive'"
decoration-muted="schedule_status == 'to process'"
decoration-info="schedule_status == 'to schedule'"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="view_product_template_form_inherit_sf">
<field name="name">product.template.form.inherit.sf</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="sale.product_template_form_view"/>
<field name="arch" type="xml">
<field name="categ_id" position="replace">
<field name='categ_id' invisible="1"/>
</field>
<field name="product_tag_ids" position="after">
<field name="default_code" attrs="{'invisible': [('product_variant_count', '&gt;', 1)]}"/>
<field name="barcode" attrs="{'invisible': [('product_variant_count', '&gt;', 1)]}"/>
</field>
</field>
</record>
</data>
</odoo>