【问题标题】:Odoo: How to remove notebook pages in sales orderOdoo:如何删除销售订单中的笔记本页面
【发布时间】:2019-12-20 00:52:55
【问题描述】:

如何在销售订单中删除或修改这些笔记本页面,我在 addons/sale/views/sale_views.xml 中搜索但没有找到它们

【问题讨论】:

  • 是的,因为它来自继承的视图。那么,您需要检查它的来源?

标签: odoo odoo-12


【解决方案1】:

您不应该从表单视图中删除页面,因为它也继承自其他视图。

相反,您可以通过继承销售的view_order_form 使其成为invisible

       <record id="view_order_form_inherit" model="ir.ui.view">
            <field name="name">sale.order.form</field>
            <field name="model">sale.order</field>
            <field name="inherit_id" ref="sale.view_order_form"/>
            <field name="priority">20</field>
            <field name="arch" type="xml">
                <xpath expr="//page[@name='other_information']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//page[2]" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
            </field>
        </record>

希望这会有所帮助!

【讨论】:

    【解决方案2】:
            <!--remove the notebook pages-->
    
            <xpath expr="//page[@name='extra']" position="attributes">
                    <attribute name="invisible">1</attribute>
            </xpath>
            
            <xpath expr="//page[@name='note']" position="attributes">
                    <attribute name="invisible">1</attribute>
            </xpath>  
    

    【讨论】:

    • 欢迎来到 Stack Overflow。 Stack Overflow 上不鼓励仅使用代码的答案,因为它们没有解释它是如何解决问题的。请编辑您的答案以解释此代码的作用以及它如何改进已接受的答案,以便它对 OP 以及其他有类似问题的用户有用。
    猜你喜欢
    • 1970-01-01
    • 2012-09-16
    • 2017-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多