Skip to content
Snippets Groups Projects
Commit 2febb877 authored by Géry Debongnie's avatar Géry Debongnie
Browse files

[FIX] web: use action context in evaluation contexts

The process of evaluating a domain is not really difficult, but the hard
part is getting the evaluation context right.  The evaluation context is
supposed to contain informations coming from various sources (active id/ids,
session context, ...).  Before this commit, we just ignored the context coming
from the action.

This could cause many problems. For example, in the Inventory
application: create a picking, add 10 ice cream in initial demand, force
assign, click on scrap.  A form view should be opened (with the context
coming back from the button_scrap method).  In that formview, there is a
many2one Product.  Clicking on it should perform a name_search with a
domain looking like ['id', 'in', [64]].  This domain is the result of
the evaluation of "[('id', 'in', context.get('product_ids', []))]".
Before this commit, product_ids was ignored, so the domain was always
['id', 'in', []].

In this commit, we simply add the element context in the list of sources
when computing the evaluation context (the element context is the
context given to the view, which is the way an action give a context to
a view)

In short, handling context is hard...
parent 2c84ecc9
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment