Technical mailing list archives

technical@mail.odoo.com

Avatar

Re: Dynamically assign a domain in Odoo 10 CE

by
Chidozie Kingsley Okonkwo
- 2018年08月28日 12時26分46秒
Hi;
Maybe this can help you: Odoo how domain attribute works?

<td class="ydp8376d6cccard-primary-image-cell" background="https://s.yimg.com/lo/api/res/1.2/1wUG32ibNb9ItOe48vjFFw--~A/Zmk9ZmlsbDt3PTQwMDtoPTIwMDthcHBpZD1pZXh0cmFjdA--/https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded.cf.jpg" bgcolor="#000000" valign="top" height="175" style="background-color: rgb(0, 0, 0); background-size: cover; position: relative; border-radius: 2px 2px 0px 0px; min-height: 175px;">

Odoo how domain attribute works?

I have a One2many relation in my odoo ' student .student' model that's it result_ids = fields.One2many("scho...



On Tuesday, August 28, 2018, 5:25:10 PM GMT+1, Christian Zöllner <c.zoellner@intero-technologies.de> wrote:


Hi,

typically you need the fields you depend on on that model form view. They can be visible or invisible.

Let's look at an easy example the partner category. That category should be obviously on res.partner (category_id) and crm.lead (partner_category_id).

Your partner_id field domain in the crm.lead form view should be [('category_id', '=?', partner_category_id)]. Why the operator '=?' --> if partner_category_id is None/False the whole domain will result in a true and therefore show all partners.

Best Regards


Von: "Johan Van Hirtum" <johan@vanhirtum.be>
An: "Odoo S.A. Technical" <technical@mail.odoo.com>
Gesendet: Dienstag, 28. August 2018 17:50:22
Betreff: Dynamically assign a domain in Odoo 10 CE

Dear Odoo experts,

 

We have a many2one ( or maybe a many2many ) field in a form view and we want the search domain for this field to be depending on another field on the form. For example in CRM, we want the search list for the partner_id to be restricted to a partner category or a company or a city depending on the sales channel or a campaign. We have tried a lot of things but we cannot achieve this. Can someone point us in the right direction please ?

 

With kind regards,

 

 

Van Hirtum Johan

_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe



--
Christian Zöllner
E-Mail: c.zoellner@intero-technologies.de

Intero Technologies GmbH
Heinrich-Heine-Ring 76
D - 18435 Stralsund
Tel:  +49 (0) 3831 – 44 55 7 - 0
Fax:  +49 (0) 3831 – 44 55 7 - 79

Internet: www.intero-technologies.de

Intero Technologies GmbH • Firmensitz: Heinrich-Heine-Ring 76, 18435 Stralsund , Deutschland • Registergericht: Amtsgericht Stralsund, HRB 7076 • Geschäftsführer: Frank Löffler, Lars Lifson • USt-Ident.Nr. DE 251251697

This eMail and its content is dedicated to the intended recipient only. If you have received it in error please contact the sender immediately by fax or return eMail. Please then delete the eMail and any copies of it.

_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

Reference