Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
6522 Lượt xem

I am trying to add a condition to an exisiting domain.

I would like to not have to copy the whole thing from the parent, but just add it in the attributes, but that does not work because of the domain has the square brackets around it.


<xpath expr="//tree/field[@name='account_id']" position="attributes">

<attribute name="domain" add="('external_use','=',True)" />

</xpath>


So i end up with a value like

[('deprecated', '=', False), ('user_type_id.type', 'not in', ('receivable', 'payable'))],('external_use','=',True)

Any idea how i can fix this ? else i have to revert to copying in the whole thing. But just adding looks cleaner.

Ảnh đại diện
Huỷ bỏ

You can use "add" with class attribute but not with domain so you need to copy the old domain and add to it.

Câu trả lời hay nhất

Hi Jaco Waes,

Find Example code in Comment. 

Hope this answer helps you.
Thanks.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Ảnh đại diện
Huỷ bỏ

You cannot use "add" in an attribute you can set a domain like the below example:

<xpath expr="//tree/field[@name='account_id']" position="attributes">

<attribute name="domain">[('deprecated', '=', False), ('user_type_id.type', 'not in', ('receivable', 'payable')), ('external_use','=',True)]</attribute>

</xpath>

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 25
2030
1
thg 2 24
1593
1
thg 6 25
1488
3
thg 7 25
3181
1
thg 5 25
1316