The function remove_domain_leaf is currently used for project burdown chart. Due to an increasing need of such a function in multiple modules for various functional cases, it has been decided to: - Move this function in 'resource' that is imported in all the modules where this function is needed. - Implement extensive unit test to ensure that it address corner cases. - Refactor the function to address the corner cases it was not addressing until now. The refactored function 'filter_domain_leaf' is used to transform a given domain to a new domain using only the leaves that verify a given check (more precisely, the leaves whose first element verify this check). To perform this transformation, the leaves that do not verify this check are considered as undetermined. All the logical operators dealing with undetermined leaves are ignored, which means: - AND(leaf, ?) = leaf - OR(leaf, ?) = leaf - AND(? , ?) = ? - OR(?, ?) = ? - NOT(?) = ? If the result of the operation is undetermined, it is returned as an empty domain ([]). closes odoo/odoo#105470 Related: odoo/enterprise#33657 Related: odoo/upgrade#4221 Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
9 lines
222 B
Python
9 lines
222 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from . import resource
|
|
from . import resource_mixin
|
|
from . import res_company
|
|
from . import res_users
|
|
from . import utils
|