Hello !
I'm trapped here, i know how to check if a field many2many or one2many is empty but now i would like to check if it is a singleton or not (if there is 1 record or not inside of it)
for the structure : my view is based on "label" class which has a many2one field on "template" class and a many2many on "product" class. I would like to show some template based on wether or not the product field is a singleton.
I've tried many things here but i can't find the solution i would like something like :
<field name="template" domain="[('len(label.products)','=',1)]"/> |
But len here doesn't work.
I even tried :
<field name="template" domain="[('label.products.ensure_one','=',True)] |
But this doesn't work neither.
Thank you all ! :)
You said you have a many2one and many2many field in class label.
Domain for many2one(in your case for template) is used to check or filter the model which the many2one is refering to.