Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
4055 Переглядів
<xpath expr="//sheet/notebook/page/field[@name='order_line']/tree/field[@name='product_uom_qty']" position="after">
<
field name="product_uom" attrs="{'column_invisible': [('parent.state', 'not in', ['draft', 'sent'])]}"/>
</
xpath>

other schools operate and this school is not, who can tell me why
Аватар
Відмінити
Найкраща відповідь

Hello,

First, make sure you have enabled Units of Measure from Sales > Configuration.

and put the following code,

<record id="view_sale_order_form_inherit_" model="ir.ui.view">

             <field name="name">sale.order.form.inherit</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='order_line']/tree/field[@name='product_uom']" position="attributes">

                    <attribute name="attrs">{'readonly': [('state', 'in', ('sale','done', 'cancel'))], 'column_invisible': [('parent.state', 'not in', ['draft', 'sent'])]}</attribute>

                </xpath>

             </field>

        </record>

Thanks


Аватар
Відмінити
Автор Найкраща відповідь
Bouabaker Abdallah 

I tried a lot of cases and including your case, it doesn't work
Аватар
Відмінити
Найкраща відповідь
try this 
    <field name="product_uom" attrs="{'invisible': [('parent.state', '!=', ['draft', 'sent'])]}"/>
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
лют. 25
800
2
жовт. 24
3726
1
серп. 24
1207
Removeing attrs in 17.0 Вирішено
2
черв. 24
2416
1
лют. 22
4566