Odoo Help

2

0
16 Answers
2
Avatar

ClueLogics Technologies Pvt. Ltd. India

--ClueLogics Technologies Pvt. Ltd.--
6213
| 7 5 10
Delhi NCR, India
--ClueLogics Technologies Pvt. Ltd.--

 ClueLogics Technologies Pvt Ltd is a Software product and services provider. We are positioned to deliver robust, rapid and reliable Information Technology solutions that work. What we succeed upon is Technology and Technical Expertise. The industry review of ClueLogics has been commendable for the past years as most of its business comes from repeat orders by highly satisfied clients.

ClueLogics Technologies Pvt. Ltd. India
7/9/15, 8:11 AM

Always use  in operator in domain if you seems need to check more then one such as many2many.



it shoud be domain="[('group_ids','in',[group_id])]"

2
Avatar

Mohammad Alhashash Egypt

--Mohammad Alhashash--
2103
| 6 5 10
October City, Egypt
--Mohammad Alhashash--

Developer

Mohammad Alhashash Egypt
4/5/13, 6:04 AM

Try this

  ...
  <field name="user_id" domain="[('groupd_ids','=', group_id)]"/>
  ...
7 Comments
Vivekrajan Rayappan India
4/5/13, 6:53 AM

Hi Mohammad,

Thanks for your reply. Your suggestion does not work.

Please see the logic inside your filter

<field name="user_id" domain="[('groupd_ids','=', group_id)]"/>

[field name="user_id" domain="[([1,3,4],'=',[1])]

This does not work. Please suggest me something else.

instead of '=' operator, if you have something like 'group_ids','has','group_id', it can work. But we dont have any such operator.

please suggest me a work around to achieve this.

Thank you

Vivekrajan Rayappan India
4/5/13, 6:55 AM

Hi, i found a link : http://forum.openerp.com/forum/topic23503.html , but I am not able to use that. If you could give me a sample code, It would be great. Please do the needful

Mohammad Alhashash Egypt
4/5/13, 7:58 AM

Actually x2many field handling in left-hand side of domains does not work as you think. You may have to quote the right-hand side ('group_id' instead of group_id). Check it and tell me the result.

Vivekrajan Rayappan India
4/5/13, 8:09 AM

that is also not working. Please see this link and tell me if tat works. http://forum.openerp.com/forum/topic23503.html

Vivekrajan Rayappan India
4/5/13, 9:02 AM

Please somebody help me on this.. I am in a big trouble

Mohammad Alhashash Egypt
4/5/13, 9:18 AM

My answer works in v7.0. I'm not sure about version 6.1. Sorry.

Mohammad Alhashash Egypt
4/5/13, 9:26 AM

It should work too in 6.1. Check the line: &lt;field name="stage_id" domain="section_id and [('section_ids', '=', section_id)] or []" /&gt; in addons/cr,/crm_lead_view.xml

2
Vivekrajan Rayappan India
5/31/13, 9:15 AM

Hi Mohammad,

The answer you provided is the right one to filter based on many2many. I actually had the same domain filter in my code. But because of some redundancy of fields, it did not work.

Later I just removed the redundant fields and it worked like a charm.

so, The right answer is what you have suggested at first.

<field name="user_id" domain="[('groupd_ids','=', group_id)]"/>

Thanks for your support and sorry for the delay in updating the answer for my question.

2 Comments
Mohammad Alhashash Egypt
6/1/13, 7:43 AM

You should not create a new answer for responding. Please read the FAQs. If the answer is correct, you should accept it and use the comment feature for response,

Vivekrajan Rayappan India
6/1/13, 8:54 AM

Ok. I shall keep that in mind henceforth. Thanks

0
Gregor Heger Germany
11/26/15, 2:55 PM

@Daniel Blankco

i know it is late, but in case somebody different reads this: function_id is located in the list view function_ids. Thereby, the scope of the domain lies within function_ids. So it it is not possible to address "function_ids" just by writing "function_ids[0][2]". The parent view, in which function_ids is located, has to be adressen. That is why parent. is for.
Entries in the function_ids list are represented by this list: [(6, 0, [1, 2, 3, 4])]. This is a so called x2many code. The ids of the function id fields is located in [1, 2, 3, 4]. So in order to address it, he writes parent.function_ids[0][2].
I don't really know why he is doing that.

0
namiri Morocco
9/22/14, 7:14 PM

try this

<field name="function_id" readonly="False" domain="[('id', 'in', parent.functions_ids[0][2])]"/>

1 Comment
Daniel Blanco Chile
4/5/15, 10:37 AM

@namiri, saw this in another question and post. Could you pleas explain each term inside the domain? I understand that 'id' referes to "the id of function_id", but parent... who is parent in this case? and what [0][2] stands for? refers to the element of the many2one declaration?

Ask a Question
Keep Informed
1 follower(s)
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