Community: Framework mailing list archives

RE: Enhancment proposal, new domain operator "parent_of"

- 05/10/2015 22:05:24


I need this too.



Thank You.


Best Regards,

Hans Yonathan

Odoo Support


Expert in Finance, Information System & Business Intelligence

Odoo Silver Partner


Tel. 13670137019 (China - Shenzhen)


From: Caudal Eric []
Sent: Saturday, May 09, 2015 6:23 PM
To: Community: Framework
Subject: Re: Enhancment proposal, new domain operator "parent_of"



Eric Caudal

On May 9, 2015 6:12 PM, "Mohammad Alhashash" <> wrote:

I'd like to purpose a new operator "parent_of" with similar semantics to "child_of" operator but it would traverse parents instead of children.

Here is an implementation based on master:

If the concept is accepted, I'll add unit tests and documentation updates to make a pull request.

There are several use cases for this operator. For example, I need to allow child companies to inherit partners and products from parent companies, but not siblings or cousins. So, when product or partner is defined on a company, it will be limited to this company and its children.

To implement this without "parent_of" operator, we have to hard code domains for each company. But, using "parent_of", it would be very simple For example, in order or invoice, partner_id would have a domain "[('company_id', 'parent_of', company_id)]". Record rule would be simple too.

Kindly, check the mentioned branch and add comments here or at the commit:


Mohammad Alhashash

Post to: