Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
4011 Представления
<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
52
0
февр. 25
764
2
окт. 24
3644
1
авг. 24
1175
2
июн. 24
2209