Odoo Help

1

[V8] Suppress value of a field if {string} with attrs?

By
FEDERICO LEONI
on 5/19/15, 7:40 PM 907 views

I would like to "mute" the qty field on pos.order form for predetermined products starting with (or containing) the char '#'.

<field name="qty" on_change="onchange_qty(product_id, discount, qty, price_unit, context)"  attrs="{'invisible':[('product_id',whathere?,'#')]}"/> 

What should be the correct syntax for attrs? Is there any problem using this parameter with on_change? 

-1

Hi,

you need to define your field as like below.

<field name="qty" on_change="onchange_qty(product_id, discount, qty, price_unit, context)"
attrs="{'invisible':[('product_id.name','ilike','#')]}" />

When product name is containing "#" at that time "qty" field will be invisible.

No. It doesn't work with 'product_id.name': Uncaught Error: Unknown field product_id.name in domain [["product_id.name","ilike","#"]]. Please note the -1 is not mine. :)

FEDERICO LEONI
on 5/20/15, 8:32 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 5/19/15, 7:40 PM
Seen: 907 times
Last updated: 5/20/15, 5:52 AM