summaryrefslogtreecommitdiff
path: root/addons/web/controllers
diff options
context:
space:
mode:
authorSimon Lejeune <sle@openerp.com>2019-12-03 16:57:27 +0000
committerSimon Lejeune <sle@openerp.com>2019-12-04 10:59:59 +0000
commit1ae66862d5570ebdb97ba0301ff591c27b969254 (patch)
tree348069d24895d0764b4b042e27c60405dcfb5143 /addons/web/controllers
parent53658052ae653a5e4e12c07dc459bb621365d2f5 (diff)
[REF] stock: products on hand action
Instead of hardcoding a domain in the action, we add a field that will be used to apply the domain. The goal is to be able to define a static domain in the xml so we'll be able to default on the filter while still being able to remove it. Let's consider this usecase: Physical | \ WH Subcontracting | | Stock 5 units | 10 units With the hardcoded domain, we have two problems - the right part of the tree isn't visible - the user can add a quant in subcontracting but it will disappear at the creation since it isn't part of the hardcoded domain. The complicated part of the domain is the `_get_domain_locations` call. It will use multiple context keys, the current company and get the hierarchy of internal locations below warehouses to see what it should include or not. To be able to remove a domain, it should be declared in the xml and not hardcoded in the action. Since the domain is complex, we can't express it. So we add a computed field "on_hand" and its search method is overiden to call `_get_domain_locations`. task-2061825 closes odoo/odoo#40403 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Diffstat (limited to 'addons/web/controllers')
0 files changed, 0 insertions, 0 deletions