I'm testing how to make the create "add a product" element of the
sale.order.form view invisible in case the status of the sales order is
draft or sent. I'm not getting the following rule to be met inside the
element:
<create string = "Add a product" attrs = "{'invisible': [('state', 'not in', ['draft', 'sent'])]}" />
But I can't make it happen.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hi,
Try this.
<field name="order_line" attrs="{'readonly':[('state', 'not in', ['draft','sent'])]}">
Thank you
hello Kripal
This attrs is correct for the "field" tag but not for the "create" tag, I suppose it must be another syntax so that these types of rules or attributes can be applied.
Hello Franklin
If you want to invisible "Add a Product" then use like this
I think it's helpful for you.
Ex.
<xpath expr="//field[@name='order_line']/tree/control/create[1]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
Hello Nikul Chaudhary
I don't want "Add a product" to be permanently invisible, but to be invisible when state is draft or sent. Also I think xpath is used only when inheriting a model. In this case I am directly editing the source model. If you could help me with those parameters I will be very grateful.
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
4
thg 9 20
|
3621 | ||
|
2
thg 9 21
|
5465 | ||
|
1
thg 7 19
|
2898 | ||
|
1
thg 5 16
|
5945 | ||
|
2
thg 3 15
|
8697 |