跳至內容
選單
此問題已被標幟
2 回覆
7399 瀏覽次數

Why the domain below is not correct?

I want to display record with

(type = delivery AND parent_id = partner_id) 
OR 
(is_company = True AND id = partner_id)

i want to edit domain attribute of field partner_shipping_id of model sale order

<attribute name="domain">"['|','&',('type', '=', 'delivery'),('parent_id', '=', partner_id),'&',('is_company', '=', 'True'),('id', '=', partner_id)]"</attribute>

Thanks

頭像
捨棄
最佳答案

Try this (True instead of 'True', replace & by &amp;) :

<attribute name="domain">['|','&amp;',('type', '=', 'delivery'),('parent_id', '=', partner_id),'&amp;',('is_company', '=', True),('id', '=', partner_id)]</attribute>



頭像
捨棄
作者 最佳答案

it's not correct.

i can save only with the expression below (removing '&').

But with this expression Odoo returns 0 record


"['|',('type', '=', 'delivery'),('parent_id', '=', partner_id),('is_company', '=', True),('id', '=', partner_id)]"






頭像
捨棄

My answer updated.

作者

Thank you!! Solved!!