Commit Graph
100 Commits
Author SHA1 Message Date
Mathieu Duckerts-Antoine 4e70ca384d [FIX] web: domain selector dialog: validate domain on confirm
With ab4f45b, the domain validation done
on confirmation in the domain selector dialog was removed. Now that we
have a new route /web/domain/validate (see previous commit) that allows
us to quickly check the validity of a domain, we can reintroduce the
validation.

closes odoo/odoo#128913

X-original-commit: fa7788fac3c48e95dcbe78abb66ac5c284d27c56
Related: odoo/enterprise#44291
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-19 11:40:10 +02:00
Mathieu Duckerts-AntoineandOliver Dony afdb546e44 [FIX] web: domain field: quick save after debug edit
When a domain field value is edited via the debug textarea, no
search_count is done for performance reasons. A single exception is done
when saving the record. Then we check the validity of the domain created
in the debug textarea in order to avoid to save an invalid domain in db
(and get tracebacks,..). The problem is that a search_count can take a
very long time to be executed if the domain is valid. Here we introduce
a route /web/domain/validate in order to quickly check the validity of a
domain and use it in domain field in order to fix the above mentionned
performance issue. Note that the search_count is still done if it useful
but does not have to be waited anymore.

X-original-commit: 40288221c39ff8fba41cd6ac231ab33600dc0cd4
Part-of: odoo/odoo#128913
Co-authored-by: Oliver Dony <odo@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-07-19 11:40:09 +02:00
Mathieu Duckerts-Antoine 9c8c2a8c30 [FIX] web: model field selector: padding below path description
We make the elements of the path description be a bit above the bottom
line in the model field selector.

closes odoo/odoo#121688

Related: odoo/enterprise#41660
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-07-13 14:47:13 +02:00
Mathieu Duckerts-Antoine db67719fd6 [FIX] web: domain selector: bar below autocomplete
We add the class o_input to the root node of the DomainSelectorAutocomplete
component in order to get a line below the tags and the input value.

Part-of: odoo/odoo#121688
2023-07-13 14:47:13 +02:00
Mathieu Duckerts-Antoine fb9629cb6d [IMP] web: domain selector: autocompletion for relational fields
For the relational fields and the operators =,!=,in,not in, we allow
the user to use autocompletion as in a many2one or a x2many field.

Task ID: 3291990

Part-of: odoo/odoo#121688
2023-07-13 14:47:12 +02:00
Mathieu Duckerts-Antoine ff2ee462a5 [IMP] web: search bar: facet descriptions
We improve the facet descriptions of the domain created via the domain
selector. We do this in several ways like it was done for the readonly
mode of the domain selector:
    - instead of displaying ids for relational fields, we display the
      associated names.
    - instead of displaying values for selection fields, we display the
      associated labels.
    - quotes around strings are not displayed by default. They are if
      there is some ambiguity: the presence of a value of another type
      like 0, false or an expression makes necessary to put them.

Task ID: 3291990

Part-of: odoo/odoo#121688
2023-07-13 14:47:12 +02:00
Mathieu Duckerts-Antoine 56ede17854 [IMP] web: domain selector: display in readonly mode
We improve the readonly mode in several ways:

    - instead of displaying ids for relational fields, we display the
      associated names.
    - instead of displaying values for selection fields, we display the
      associated labels.
    - quotes around strings are not displayed by default. They are if
      there is some ambiguity: the presence of a value of another type
      like 0, false or an expression makes necessary to put them.

Task ID: 3291990

Part-of: odoo/odoo#121688
2023-07-13 14:47:12 +02:00
Mathieu Duckerts-Antoine e10f965c36 [FIX] web: domain selector: 'New rule' button size
The button "New rule" was too easily clickable since it took a whole
line. We reduce its size.

Part-of: odoo/odoo#121688
2023-07-13 14:47:12 +02:00
Mathieu Duckerts-Antoine a1365d7655 [IMP] web: model field selector: search on string and name in debug mode
We allow the user to make a fuzzy search on the string and the name of
the fields when the props isDebugMode is true.

Part-of: odoo/odoo#121688
2023-07-13 14:47:11 +02:00
Mathieu Duckerts-Antoine a3b00f2dca [FIX] web: domain selector: operators with same key
Before that commit, we could get two operators with the same key to
display at the same time. In that case, an error would be thrown by OWL:
Got duplicate key in t-foreach... . We fix that problem.

Part-of: odoo/odoo#121688
2023-07-13 14:47:11 +02:00
Mathieu Duckerts-Antoine bac8c7a5d6 [FIX] web: domain selector dialog: do not validate domain server side
Even with a limit of 1, the domain validation done in the domain selector
dialog at confirmation can be too costly (see PR message). Since we do
not have (yet) the tools to validate quickly domains server side, we
simply drop the validation server side.

closes odoo/odoo#127832

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-13 03:57:40 +02:00
Mathieu Duckerts-Antoine 15bbf69a76 [FIX] web: domain selector dialog: disable confirm button on click
On confirmation of a domain created in the domain selector dialog, a
validation check involving the server is done. That validation based on
a search_count can be rather/too costly (see PR message). Since the
search_count is done in silent mode and the confirmation button is not
disabled on click, if the validation takes too much time, the user is
lead to think that the first click did not work and clicks again, and so
on...

Here we disable the button on appropriate time to avoid that situation.

Part-of: odoo/odoo#127832
2023-07-13 03:57:40 +02:00
Mathieu Duckerts-Antoine 34f68a5f19 [FIX] web: search bar: is (not) (not) set in facets
Before this fix, a condition like "Foo is not set" created via the domain
selector would be badly described in the facet as "Foo is set".
We fix that problem and add a test that covers that situation and similar
ones.

closes odoo/odoo#127447

X-original-commit: a6b7de5d62906e5508585e0b994bf95544d10476
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-07 17:57:45 +02:00
Mathieu Duckerts-Antoine 1c2c18a0a5 [FIX] web: domain selector: invalid path/operator
We make the domain selector accept any expressions in the first and
second components of a domain condition. Along the way, we have found
necessary to refactor the Tree type (see domain_tree.js) and use it
directly in the domain selector instead of having yet another auxiliary
structure. Another simplification brought by this commit is that the
virtual operators is, is_not, set, and not_set are introduced earlier
and make possible to simplify the way operators are managed.

closes odoo/odoo#126350

Related: odoo/enterprise#43161
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-07-03 16:58:55 +02:00
Mathieu Duckerts-Antoine b72791f05b [REF] web: remove unused props in TagsList
Some props like className were declared as optional in TagsList while
they are not used by the component. We remove them from the props
declaration.

Part-of: odoo/odoo#126350
2023-07-03 16:58:55 +02:00
Mathieu Duckerts-Antoine 2b23f73f51 [IMP] web: domain selector: use TagsList in TagInput
We make TagInput use the generic component TagsList. This gives a better
looking/working to the editors used for the operators "in"/"not in" for
char fields.

Part-of: odoo/odoo#126350
2023-07-03 16:58:55 +02:00
Mathieu Duckerts-Antoine 1b94eefe26 [FIX] web: domain selector: treat false,true as in py interpreter
A string representation of a domain like "[('bar', '=', false)]" is
evaluated by py.js the same way as "[('bar', '=', False)]".So both domains
are recognized as correct while false is not a valid python expression.
We do the same in domain selector, the expression "false" ("true")
will be understood as "False" (resp. "True").

Part-of: odoo/odoo#126350
2023-07-03 16:58:54 +02:00
Mathieu Duckerts-Antoine 089e0e680c [IMP] web: domain selector: in/not in labels
We change the label of "in" to be "is in". The label of "not in" becomes
"is not in"

Task ID: 3291990

Part-of: odoo/odoo#126350
2023-07-03 16:58:54 +02:00
Mathieu Duckerts-Antoine 7a13c3f3d0 [IMP] web: domain selector: getDefaultFieldValue should know operator
The computation of the default value used by an editor used to assume
that the (default) operator is equal. We now pass the operator info to
getDefaultFieldValue in order to be able to have a different default
operator ("in" will become the default operator for relational fields).

Part-of: odoo/odoo#126350
2023-07-03 16:58:54 +02:00
Mathieu Duckerts-Antoine 03858851a9 [REF] web: domain tree: add negate key
The key negate is defined as mandatory in the definition of the type Tree.
We add them at some places (event if it did not pose a problem for now:
undefined and false are both falsy).

Part-of: odoo/odoo#126350
2023-07-03 16:58:54 +02:00
Mathieu Duckerts-Antoine be005408fb [FIX] web: search bar: background color for comparison facet label
The label of a facet with type "comparison" did not have any
background color. We set it to be the same as for the label of a facet
of type "groupBy".

closes odoo/odoo#126496

X-original-commit: b0527528ee73b503ffbfef491b2389018c119376
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-06-27 13:44:23 +02:00
Mathieu Duckerts-Antoine 842aeacb56 [FIX] web: search bar: no button role for comparison facet label
The label of a facet of type "comparison" had the role "button" while
click on it has no effect. That role should be reserved for the label of
a facet that is associated with a domain (e.g. a facet of type "filter").

X-original-commit: 4c649abf491b32c218769b0bb1eba19881dedbb0
Part-of: odoo/odoo#126496
2023-06-27 13:44:22 +02:00
Mathieu Duckerts-Antoine 876a82b299 [FIX] web: distribute ! or not
When the domain selector is in debug mode (props.isDebugMode = true),
the operator ! (not) is not distributed in the leaves in the domain
selector. That is a domain like ["!", "|", ("foo", "=", 1 ), ("id", "=", 2)]
will be visualized in the domain selector as

Match records with none of the following rules:
  Foo = 1
  ID = 2

The problem we fix is that when such a domain is added via "Add Custom
Filter" (for instance), the search bar facet produced has a representation
of the domain where ! has been distributed even if the debug mode is
active. With the previous example:

------------ -----------
| Foo != 1 | | ID != 2 |
------------ -----------

This makes the user think that the domain she sees is not the domain
she has created.

In the present commit, we make sure that the ! operator is distributed
or not uniformly within the scope of the search model.

closes odoo/odoo#125967

X-original-commit: d15d7e13be0ca6f7705c3bb6f992b45949bccef0
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-06-22 09:50:31 +02:00
Mathieu Duckerts-Antoine 6adcd292b3 [FIX] web: search panel: fields should not be added in search bar
Let us consider the search arch

    <search>
        <field name="foo"/>
        <searchpanel>
            <field name="bar"/>
        </searchpanel>
    </search>

The two tags "field" are supposed to generate different objects:
 - the first one should generate an entry in the search bar autocompletion
 - the second one should generate a search panel section.

It turns out that the second field did also generate an entry in the
search bar. This is of course wrong. We fix that problem and add a test.

closes odoo/odoo#125724

X-original-commit: 7e62e3cf569e59a676a834198854f415fa0ae590
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-06-20 15:58:35 +02:00
Mathieu Duckerts-Antoine 850d52d0ae [FIX] web: orm: protect webSearchRead
The values for the key "async" found in some services is used to declare
async methods that should be "protected". The hook "useService" makes sure
that no code used to process results of those protected methods is
executed by a destroyed component. The orm method "webSearchRead" was
not protected due to a "typo".

closes odoo/odoo#125688

X-original-commit: 2899888a2449b42b2c5d37846fc9411da6f7f9cc
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-06-20 09:11:04 +02:00
Mathieu Duckerts-Antoine fa0f687337 [FIX] web: orm: protect nameGet
The values for the key "async" found in some services is used to declare
async methods that should be "protected". The hook "useService" makes sure
that no code used to process results of those protected methods is
executed by a destroyed component. The orm method "nameGet" was
not protected due to a "typo".

closes odoo/odoo#125683

X-original-commit: c2b9f14fa9fbf67063b8885b698ea17a63d79454
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-06-20 00:24:06 +02:00
Mathieu Duckerts-AntoineandLucas Lefevre dacb31aa85 [REF] spreadsheet: use name service in DisplayNameRepository
We make the class DisplayNameRepository use the name service instead of
BatchEndpoint. This makes the code simpler and allow to avoid a lot of
rpcs (in some occasions) when fetching display names.

closes odoo/odoo#124090

Related: odoo/enterprise#42124
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Lucas Lefevre <lul@odoo.com>
2023-06-09 17:00:48 +02:00
Mathieu Duckerts-AntoineandLucas Lefevre c41fb94946 [REF] spreadsheet: simplify DisplayNameRepository
The method getDisplayNameAsync being no more called, DisplayNameRepository
has no need to manage deferreds. We simplify it.

Part-of: odoo/odoo#124090
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Lucas Lefevre <lul@odoo.com>
2023-06-09 17:00:48 +02:00
Mathieu Duckerts-AntoineandLucas Lefevre f2edbb27f4 [IMP] web: name service
We define a new service "name". That service makes possible to load in
batch display names and maintains a cache. Some known display names
(fetched otherwise) can be added to the cache. The cache is cleared at
least each time the UI is updated via _updateUI (action service).

Part-of: odoo/odoo#124090
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Lucas Lefevre <lul@odoo.com>
2023-06-09 17:00:47 +02:00
Mathieu Duckerts-Antoine d2637f617d [IMP] web: search model: merge =, in values in facet descriptions
A domain of the form ["|", ("foo", "=", "a"), ("foo", "in", ["b", "c"])]
created via the domain selector will be presented in the search bar as
"Foo in ( a , b , c )". That is we make the fusion of some
conditions and use parenthesis and commas to separate the values in order
to get shorter facet descriptions.

closes odoo/odoo#123352

X-original-commit: 3d2580db3225382ab745250b28845f6cb95cbd27
Related: odoo/enterprise#41814
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-06-05 13:31:48 +02:00
Mathieu Duckerts-Antoine 1d77694b95 [IMP] web: domain selector: add a 'New Rule' button
In edit mode, we add a 'New Rule' button at the bottom of the domain
selector to make easier to add a new condition.

X-original-commit: 2e761f8965909e4b11d3319c48bd5416c414961f
Part-of: odoo/odoo#123352
2023-06-05 13:31:48 +02:00
Mathieu Duckerts-Antoine 2860156adf [FIX] web: domain selector: always show connectors
When a domain with a single condition is displayed in a domain selector,
the implicit connector "&" or "|" is not displayed. This makes the
operation 'Add node' less obvious in that case since it is not known how
the new condition will be combined with the others.
Here we always display the connector to solve that problem.
As a by-product, we get another problem solved: a domain of the form
["!", ("foo", "=", "abc")] was incorrectly displayed.

X-original-commit: bd57f20980734641ce405bd34d8b17dc780adb17
Part-of: odoo/odoo#123352
2023-06-05 13:31:48 +02:00
Mathieu Duckerts-Antoine 606bc349e9 [FIX] web: search model: remove quotes in facet description
When a new search bar facet is created via the domain selector dialog,
quotes are sometimes put around some parts of its description, e.g.
Country = "Belgium". We make the facet description more readable by
removing those quotes.

X-original-commit: 2c12980e129acf9ffe5e1e474d3dee6abb7adfe4
Part-of: odoo/odoo#123352
2023-06-05 13:31:48 +02:00
Mathieu Duckerts-Antoine 5304d8fc64 [REF] *: remove legacy search models/components
There is no action that uses the search models/components available in
the legacy control panel. We remove those.

closes odoo/odoo#121433

Related: odoo/enterprise#41078
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-05-16 15:55:24 +02:00
Mathieu Duckerts-Antoine 42907462fc [REF] web: callback recorders: from env to props
The fact that callback recorders are put in the env by the action
service has a serious disadvantage. A view using itself some View component
can have easily its own local state and global state polluted by that
subview (views use useSetupView). This would lead to very subtle
problems hard to detect and understand. Moreover, we view the callback
recorders as rather technical stuff and we would like the developers not
to have to think about them. For that reason we pass the callback
recorders as (optional) props to the View component that make them
available in the env. Note that the situation remains unchanged for
client actions (we do not have a View analog component for the actions).

closes odoo/odoo#121050

Related: odoo/enterprise#40901
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-05-15 13:59:14 +02:00
Mathieu Duckerts-Antoine 4e33d82e2f [FIX] web: graph: avoid some useless chart renderings
With a slow network, make a new search in the search bar of a graph view
would lead the graph renderer to be rendered twice. This was due to the
fact that in the graph controller template an arrow function is passed
as a prop to the graph renderer. The reactivity system treats that prop
as changing at each graph controller rendering and ask unnecessarily (in
this case) the graph renderer to render.

closes odoo/odoo#121292

X-original-commit: dab0187e382e5f93dd5ccc78ecbd7e2f47f5c75e
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-05-12 20:52:23 +02:00
Mathieu Duckerts-AntoineandMichaël Mattiello c1436ba8ca [IMP] *: advanced search
We allow edition/creation of domains with a domain selector via the
search bar facets or the menu "Add Custom Filter".
The domain selector has also been improved and now support expressions
and a new operator "between" for some field types (those for which <=
and >= are valid operators). We also improve the support of the connector
not.

Task ID: 3063564

closes odoo/odoo#112326

Related: odoo/enterprise#37715
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
2023-05-08 15:18:03 +02:00
Mathieu Duckerts-Antoine 959b57bcce [FIX] web: domain selector: parse -1
Before this commit, a domain of the form "[(.., .., -1)]" would be
incorrectly represented in the domain selector as .., .., undefined.
The root cause was that py_js view the sub expression -1 as the
application of the operation - to 1 and thus create an AST of type 6 for
it. The domain selector did not expect to get such an AST but did not
crash either. Here we make it extract the intended value from the AST
for -1. More complex expressions like 3-1 are still not supported.

closes odoo/odoo#119620

X-original-commit: f9604da60c6650ad46aafe08e9fad118654a149b
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-04-25 15:20:54 +02:00
Mathieu Duckerts-Antoine bf2cc8d7d1 [FIX] web: SampleServer: many2many in mockReadGroup
closes odoo/odoo#119350

X-original-commit: e63f8206e9658c517743966bb9e24d110fa43508
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-22 05:52:16 +02:00
Mathieu Duckerts-Antoine d8e08067d4 [IMP] web: sample server: add test file
The new SampleServer class was introduced in c67b9f9907
without dedicated tests. We fix this oversight.

closes odoo/odoo#119188

X-original-commit: 693f7bd74066fa9854db4ecef751f13ec5c7e7a6
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-20 15:21:55 +02:00
Mathieu Duckerts-AntoineandMichaël Mattiello ebf646b44f [IMP] *: ModelFieldSelector improvements
We refactor the ModelFieldSelector and ModelFieldSelectorPopover
components.

We also improve a bit ModelFieldSelectorPopover:
    - on first page, the button to go back is no longer available
      (so that it is now more difficult to produce an invalid path)
    - we always start with a page presenting the model where the last
      selected field name belongs to
    - the keyboard navigation is improved
    - click on model field selector opens the popover with the focus in
      the search input (if any)
    - for relational fields in popover: the user can either click on the
      relational field (and select it) or a special button that make him
      follow the relation to the field comodel

We also refactor the hook useDynamicPlaceholder to make it use a new
component DynamicPlaceholderPopover that uses ModelFieldSelectorPopover.

Task ID: 3272798

closes odoo/odoo#117951

Related: odoo/enterprise#39673
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
2023-04-19 21:58:34 +02:00
Mathieu Duckerts-Antoine 6e4862d2ba [IMP] web: filter menu closed on advanced search
We make the filter menu close itself when the user click on its item
"Advanced Search".

Part-of: odoo/odoo#117951
2023-04-19 21:58:34 +02:00
Mathieu Duckerts-Antoine d1c40391ac [FIX] web: clickbot: fail on Advanced Search
The commit https://github.com/odoo/odoo/commit/1c374b9b0509f7d39b9d02d2f3dd7f9728aeee28 has replaced the
old "Add Custom Filter" item of the menu "Filters" by a new item
"Advanced Search" that works differently. This made the test clickEverywhere
fail. We adapt that test.

closes odoo/odoo#118884

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-04-18 12:41:35 +02:00
Mathieu Duckerts-AntoineandMichaël Mattiello b307e360be [IMP] web: DomainSelector improvements
The objective of this commit is twofold:

- improve the style of the DomainSelector component, in particular, the
  style of the control buttons "Add node", "Add branch", and "Delete node".

- add the possibility to reset the domain when the current domain is not
  supported. The debug input is also always visible in that case
  if the debug mode is active. It is displayed in readonly iff the
  corresponding DomainSelector prop is set to true.

Task ID: 3269923

closes odoo/odoo#118057

Related: odoo/enterprise#39512
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
2023-04-13 17:57:14 +02:00
Mathieu Duckerts-AntoineandMichaël Mattiello 1c374b9b05 [IMP] web: Advanced Search
The old submenu "Add Custom Filter" of the menu "Filters" is now replaced
by a menu item "Advanced Search". Click on that item will open an
"Advanced Search" dialog in which the current search domain is displayed
in a domain selector. It is then possible to easily add/remove/edit some
parts of that domain before make a new search with the edited domain.

Task ID: 3269923

Part-of: odoo/odoo#118057
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
2023-04-13 17:57:13 +02:00
Mathieu Duckerts-Antoine 01f90daef0 [REF] web: improve validation of comparison
Part-of: odoo/odoo#118057
2023-04-13 17:57:13 +02:00
Mathieu Duckerts-Antoine f61c3870dc [REF] web: move computeVariation in pivot_model
Since the dashboard view has been removed, there was only one call to
computeVariation of utils/numbers. We move the definition of that
function where it is used (pivot_model.js).

Part-of: odoo/odoo#118057
2023-04-13 17:57:13 +02:00
Mathieu Duckerts-Antoine 4b078525b5 [REF] web: search: remove support of domain parts
Since the dashboard view has been removed, there was no more true usage
of setDomainParts. We thus remove the support of domain parts.

Part-of: odoo/odoo#118057
2023-04-13 17:57:12 +02:00
Mathieu Duckerts-Antoine d0b9c092bd [IMP] web: new field service
We move the function loadFields from the view service to a newly created
field service. That service can also be used to load model fields for a
given path (loadPath), i.e. load all model fields for the models
traversed by the given path.
We use loadPath in useModelField and DomainSelector.

closes odoo/odoo#117882

Related: odoo/enterprise#39418
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-07 19:43:20 +02:00
Mathieu Duckerts-Antoine 6c5d54e1d9 [IMP] web: cache: new clear and invalidate methods
We introduce two new methods for Cache:
    - a method "clear" that can be used to delete a specific path
    - a method "invalidate" that can be used to delete all paths

Part-of: odoo/odoo#117882
2023-04-07 19:43:20 +02:00
Mathieu Duckerts-Antoine 57a04c4aa3 [IMP] web: utils: zip and zipWith functions
We introduce in utils/arrays.js, the two classical functions zip and zipWith.

Part-of: odoo/odoo#117882
2023-04-07 19:43:19 +02:00
Mathieu Duckerts-Antoine d1f450adde [FIX] web: domain: support of '=?' operator
The operator =? is recognized by expression.py as a valid operator but
was not recognized by the Domain class (see the method "contains") as
such.

closes odoo/odoo#116914

X-original-commit: b6495bd51295c513ab0d5c083560ac3a1236bd4f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-29 09:33:52 +02:00
Mathieu Duckerts-Antoine 13de75dd6f [IMP] web: domain: always throw InvalidDomainError
closes odoo/odoo#116790

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-28 14:50:53 +02:00
Mathieu Duckerts-Antoine 6540757d4a [FIX] web: Domain: improve validation
We make the class Domain detect more invalid domains.

closes odoo/odoo#116471

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-03-24 14:37:03 +01:00
Mathieu Duckerts-Antoine 1549a966cc [REF] web: graph: simplify code
We remove a useless import of GroupByMenu and refactor the processing
of data points in the model.

closes odoo/odoo#114172

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-02 17:13:36 +01:00
Mathieu Duckerts-Antoine 926c4d4769 [REF] mrp: revert partly "[IMP] mrp: adapt workorder gantt view"
Revert partly https://github.com/odoo/odoo/commit/d55e6cca0648c78ab27e0107ab7d545e9fd4972b.

Rationale: if the field workcenter_id is not found in the group_bys, the
records in a given row can be associated with different workcenters with
different unavailabilities. So if for instance two records in the same
row are related to workcenters 1 and 2 with respective unavailabilities
from Monday to Wednesday, and Thursday to Sunday, that row would be
totally greyed. This leaves the user with no interesting information.

Moreover, we are about to refactor the GanttView and we want to simplify
the API of the method gantt_unavailability, in particular we do not want
to send row records anymore.

Part-of: odoo/odoo#112756
Co-authored-by: Mathieu Duckert-Antoine <dam@odoo.com>
2023-02-28 20:38:50 +01:00
Mathieu Duckerts-Antoine efe09fd7ad [FIX] website_livechat: MockServer: patch _performRPC
The new MockServer has no _mockCallButton method. Due to an issue with
the patch function that does not reasign this._super correctly when
entering the _mockCallButton function, a crash did occur.

Part-of: odoo/odoo#112756
2023-02-28 20:38:49 +01:00
Mathieu Duckerts-Antoine 965fed0cd6 [REF] *: add dialogService in setupControlPanelServiceRegistry
From a practical point of view, it seems better to also add the
dialog service in the service registry when calling
setupControlPanelServiceRegistry.

closes odoo/odoo#113610

Related: odoo/enterprise#37510
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-24 14:20:30 +01:00
Mathieu Duckerts-Antoine 94c2db94e0 [FIX] *: adapt code related to orm service create
The previous commit has as a side effect to change the value returned by
the create method of the orm service. Here we adapt the code that uses it
and make the test pass.

Part-of: odoo/odoo#111965
2023-02-20 19:25:00 +01:00
Mathieu Duckerts-Antoine 8780f0db25 [IMP] web: support of array_agg for integers and floats in mockReadGroup
Let us have records with values 1, 0, 77, 3 for a float field 'foo'.
read_group allows to get those values in an array with the aggregate
function array_agg:

read_group([], ["foo:array_agg", ...], []) will return

[{ __count: 4,  foo: [1, 0, 77, 3], ... }]

We now support the use of array_agg for integer and float fields in
the mock server.

closes odoo/odoo#112825

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-16 17:56:58 +01:00
Mathieu Duckerts-Antoine cdd6b74b11 [FIX] web: support of count_distinct for many2ones in mockReadGroup
mockReadGroup should not count the value false for a many2one when
aggregating a many2one field with the aggregate function count_distinct
and should always return a number. We fix that.

Part-of: odoo/odoo#112825
2023-02-16 17:56:57 +01:00
Mathieu Duckerts-Antoine 14f6ae8b5f [IMP] web: support of array_agg for many2ones in mockReadGroup
Let us have records with values false, 1, 2, 1, 1 for a many2one 'm2o'.
read_group allows to get those ids in an array with the aggregate function
array_agg:

read_group([], ["m2o:array_agg", ...], []) will return

[{ __count: 5,  m2o: [null, 1, 2, 1, 1], ... }]

We now support the use of array_agg for many2ones in the mock server.

Part-of: odoo/odoo#112825
2023-02-16 17:56:57 +01:00
Mathieu Duckerts-AntoineandMathieu Duckerts-Antoine f3dfd9b651 [REF] web: Move orderByToString to views/utils.js
This commit moves the 'orderByToString' helper to views/utils.js.

Part-of: odoo/odoo#110819
Co-authored-by: Mathieu Duckerts-Antoine <dam@dooo.com>
2023-02-14 17:09:05 +01:00
Mathieu Duckerts-Antoine 9e3afe6d83 [REV] web: revert "[REF] web: sample server: _mockReadGroup"
This reverts commit 8d437bf.

Because of the above commit, the sample server did not correctly group
the records when a date/datetime field was used as a groupby.

We revert id and add a test.

closes odoo/odoo#110321

X-original-commit: 1a0c688aee7682919b66492636f46eff481abd29
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-01-19 08:07:53 +01:00
Mathieu Duckerts-Antoine d22928b7ed [FIX] web: sample server: populate groups
When some true groups have been fetched, the sample server use them to
construct the value returned by _mockWebReadGroup, i.e. construct some
fake groups. It also populate those groups by assigning them some
previously created fake records. It turns out that those fake records did
not have the right type when the first group by is a date/datetime field.
The record values created (during the group assignation) for that field
were luxon.DateTime instances instead of strings like "2022-12-15".

This was the root cause of the following problem.

Have a kanban view in sample mode and grouped on a date field, then
switch to a pivot view grouped on the same date field. A crash occures.

That crash is linked to the above mentionned problem in the following
way:

- open the kanban view (with sample="1" in its arch)
- some existing groups are fetched by the relation model but no records
  exist
- the kanban view switches to sample mode and some fake invalid records
  are created in the sample server (the invalidity of records do not
  cause visible problems at that time)
- switch to the pivot view
- the sample server is reused but existingGroups is set to be null, so
  that _mockWebReadGroup uses the invalid records to create the groups
  it needs. The crash occures at that step.

Forward-Port-Of:: cdd583f74f51086c8d5f243a2a761622229ccc26

closes odoo/odoo#109031

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-01-04 14:44:57 +01:00
Mathieu Duckerts-Antoine 7dd9943336 [FIX] web: sample server: _mockWebReadGroup API
When some true groups have been fetched, the sample server use them to
construct the value returned by _mockWebReadGroup. It turns out that
this construction was invalid: the value returned for the first group by
in each group had the wrong type in many cases. For instance, when the
first group by is a date field, the value returned could be an array
with a luxon.Datetime instance as first element and a description as
second element while it should be a description only (e.g. "December 2022).
We fix that problem.

Forward-port-of: 59c7c8c9adcad468ad9d985113a2b88e745b7414
Part-of: odoo/odoo#109031
2023-01-04 14:44:56 +01:00
Mathieu Duckerts-Antoine 8d437bf561 [REF] web: sample server: _mockReadGroup
The function used to group fake records in _mockReadGroup was
overcomplicated. We simplify it.

closes odoo/odoo#108921

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-03 14:33:00 +01:00
Mathieu Duckerts-Antoine 050f258bca [IMP] web: search bar: name_search context
The keys from the action context were not available in the context of
a name_search done when a user expand a one2many field in the search
bar. We add them.

closes odoo/odoo#107660

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-12 13:19:10 +01:00
Mathieu Duckerts-Antoine 74c5692f48 [FIX] web: fix the error that the name of the line is too long
- Currently the label of the lines is not limited to the number of characters. When the user gives a name that is too long, the graph will not be displayed.
- This commit limits the number of labels, if exceeded it will display as ...

closes odoo/odoo#106623

X-original-commit: 54657151957c5be5e885c245db9e1830709833c0
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-11-28 14:51:39 +01:00
Mathieu Duckerts-Antoine 84a0d31ca7 [FIX] web: search model: one2many search default labels
When a one2many is used as a search default, its label has to be fetch
via a name_get in order to get a correct display of the facet
corresponding to that field in the search bar. It turns out that the
search model did not wait properly the return of the name_gets before to
start to compute the facets.

closes odoo/odoo#106624

X-original-commit: 50f58212410b321c1c4ad3d42a91cd1d23567308
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-11-28 13:20:44 +01:00
Mathieu Duckerts-Antoine 408e075328 [FIX] web: statusbar_field: current value colors
closes odoo/odoo#105333

X-original-commit: 560e9a88b7ce33dae50054c8cc3e8fc20107f603
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-11-21 11:50:03 +01:00
Mathieu Duckerts-Antoine 6aac153473 [FIX] web: py.js: offset in to_utc
Take a (py.extras) datetime representing the moment "2022-10-17 00:00:00"
in the timezone of Brussels. Trying to get the related utc moment through
to_utc gives wrongly "2022-10-16 23:00:00". This happens because the
months are not numbered in the same way in Date or datetime, so that in
October for example, the offset applied was that of November which is
-60 instead of -120 (summer/winter change). We fix that problem.

closes odoo/odoo#103579

X-original-commit: ee1a8d26f241f2f7bea6880afcc946119b0e6bd8
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-19 20:47:54 +02:00
Mathieu Duckerts-Antoine e0b852bc6e [FIX] web: core: offset in to_utc
Take a PyDateTime representing the moment "2022-10-17 00:00:00" in
the timezone of Brussels. Trying to get the related utc moment through
to_utc gives wrongly "2022-10-16 23:00:00". This happens because the
months are not numbered in the same way in Date or PyDateTime, so that
in October for example, the offset applied was that of November which is
-60 instead of -120 (summer/winter change). We fix that problem.

closes odoo/odoo#103561

X-original-commit: a11e1fb5f702400fe51938362fe3f24570977ba9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-19 18:06:59 +02:00
Mathieu Duckerts-Antoine 8c2ec7b4de [REF] web: remove PieChart
Now that the module web_dashboard has been removed https://github.com/odoo/enterprise/pull/31641,
the component PieChart is unused. We remove it.

closes odoo/odoo#102761

X-original-commit: 3e92c60034cedcd999572bb7e93c8b05ca07be70
Related: odoo/enterprise#32573
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-19 11:11:53 +02:00
Mathieu Duckerts-Antoine dcb0498ab8 [REF] web: remove unused props in reporting views
Now that the module web_dashboard has been removed https://github.com/odoo/enterprise/pull/31641,
some props of the reporting views graph and pivot have become unused.
We remove the code related to those props.

X-original-commit: 7d231d1d37707dab4b0ecdd4e2e7cc4535ba6196
Part-of: odoo/odoo#102761
2022-10-19 11:11:53 +02:00
Mathieu Duckerts-Antoine 9f4130bd57 [FIX] web: kanban, list: no search model in env
When a x2many record is opened in a X2ManyFieldDialog, it can happen
that the form renderer displayed in the dialog also contains a x2many
that use a kanban or list renderer. In those cases, the View component
is not used. Consequently, the WithSearch component responsible for
making available a search model in the env is not used either so that
a crash occurs at the setup of the kanban renderer (and sometimes later
on for the list renderer). We fix that problem.

closes odoo/odoo#103349

X-original-commit: 2c284317b6dc3c0f0b4e9e376dcee755d81222da
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-19 10:14:55 +02:00
Mathieu Duckerts-Antoine 9a640383c9 [FIX] web: relational model: many2one update with no label
Before this commit, click on the "Search More" option in a list many2one
and then selecting an option in the opened dialog would lead to a crash.
This used to happen because the record is updated with a value of the
form [integer, undefined] (that is with no defined label) and nothing was
done in the list model to fetch that label, making impossible to render
the many2one after the update.
Here we make sure that a label is available after the update.

closes odoo/odoo#103271

X-original-commit: 81abccf729ef5b56a8656961931b7489e4364a1f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-17 13:09:18 +02:00
Mathieu Duckerts-Antoine d9cd064ef7 [FIX] web: kanban: many2one label after drop
Have a kanban view grouped on a many2one and displaying that many2one
with a widget in the record cards. Drag a record from one column to
another: a crash occurs. This happens because the record update is done
with a value of the form [id, undefined] (that is with no defined label)
and nothing is done in the kanban model to fetch that label,
making impossible to render the many2one after the update. We fix that
problem by using the known group display name as label for the dropped
record.

X-original-commit: 2a6fe373d48385485933429fbc1e6e3eabd877b4
Part-of: odoo/odoo#103271
2022-10-17 13:09:18 +02:00
Mathieu Duckerts-Antoine df6c716bc2 [FIX] web: kanban: attribute default_order
Before this commit the attribute default_order was not taken into
consideration by the kanban view.

closes odoo/odoo#103127

X-original-commit: 0116b590a47c8c12354877498e576ad28e42c1f2
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-10-12 10:34:50 +02:00
Mathieu Duckerts-Antoine 3c434afd26 [FIX] web: list: no highlight of a column without label
Before this commit, a list header with no label and associated with a
first orderBy field would be highlighted (i.e. would have the class
table-active). Since this is visually weird, we remove that class from
such a header.

closes odoo/odoo#103108

X-original-commit: 36fb5a0d170d9f5692485d0b2fc374951794cd69
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-10-12 10:34:42 +02:00
Mathieu Duckerts-Antoine fa9e74574d [FIX] im_livechat: separation icon/text in channels kanban
closes odoo/odoo#102939

X-original-commit: c55e567210fb643ac0de34df8538adca2cccd328
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-10 18:09:03 +02:00
Mathieu Duckerts-Antoine a393892e62 [FIX] mail: activity view: progress bar counters
The commit https://github.com/odoo/odoo/commit/c877cab866f2c1968f4f9aaf8ceebc02fa014eed
has recently refactored the css of the kanban column progress bar making
the rules for o_legacy_kanban_counter be applied only in legacy kanban
views. This lead the style of the progress bars in activity view to be
broken. Here we fix that style by copying the rules we want in the
file activity_view.scss.

closes odoo/odoo#102520

X-original-commit: 84788c27a6c22a55bb0d7e375ae60b78beeea050
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-06 23:14:22 +02:00
Mathieu Duckerts-Antoine 44f5d4d986 [FIX] web: breadcrumb ellipsis
Going to My profile (user menu item when hr installed), the user name
is not fully displayed in the breadcrumb although there is enough space
to display it. We fix that by removing a rule that has become apparently
useless.

closes odoo/odoo#102492

X-original-commit: 09b5b83b41cd450359993eaca510d2e5b5a429ea
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-06 19:59:04 +02:00
Mathieu Duckerts-Antoine 4044635677 [FIX] web: ModelFieldSelectorPopover: edition of path in input
Before this commit, it was not possible to edit the path via the
model field selector popover input (visible in debug mode). We fix that.

closes odoo/odoo#102462

X-original-commit: 084af201f1f4f4cb3476ab34d3dcd649a71a4254
Signed-off-by: Luca Vitali <luvi@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-06 19:04:25 +02:00
Mathieu Duckerts-Antoine 6086fb664c [FIX] project: Project Stages record style
After the update of the bootstrap lib, the kanban records to be found in
the menu Project Stages of Project > Configuration (after activation of
a setting option) had each two weird borders. Here, we simplify the
kanban-box template in order to get only one border as it is in 15.0.

closes odoo/odoo#102249

X-original-commit: 839bdd0a853f88bfaeb0dd698d60e2168dc54188
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-06 00:37:22 +02:00
Mathieu Duckerts-Antoine 6b2dab4868 [FIX] web: list: allow accurate text selection
Before that commit, it was not possible to select some part only
of a input/textarea input in an editable list view.

closes odoo/odoo#102169

X-original-commit: e572c11ecfb994a474ce800e46895e9233fae64b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-04 23:00:42 +02:00
Mathieu Duckerts-Antoine 2c60272507 [FIX] web: ModelFieldSelector: click on popover back button
Click on the back button in the model field selector popover used to
often remove too many names in the path created via the selector. For
example, starting with "partner_id.name" and clicking on the back button
in the opened popover would give the invalid path "" instead of
"partner_id". We fix that problem.

closes odoo/odoo#102156

X-original-commit: e4a7b63c68a87d7afef987e8d036d7ba9c5b6f96
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-04 20:58:04 +02:00
Mathieu Duckerts-Antoine 7db644da96 [FIX] web: DomainSelector: operator change
In a domain selector, have a selection field and the operator "is set"
selected, then change the operator to be "=". A crash occurs. This
happens because the category of operator change and thus the function
onDidTypeChange of DomainSelectorSelectionField is called with no
parameter. The same problem can happen with DomainSelectorDateTimeField.

We fix that by calling component.onDidTypeChange with the right
parameter in any case.

X-original-commit: a01c2473d93d0d123391ba0131ad505775b3c50b
Part-of: odoo/odoo#102156
2022-10-04 20:58:04 +02:00
Mathieu Duckerts-Antoine 75789de7e1 [REF] web: views: put FormLabel's template in xml.
This commit improves extensibility of FormLabel component's template

X-original-commit: f463f28f6d4c2487d59b713ad9118bbaf19b8d3c
Part-of: odoo/odoo#102153
2022-10-04 20:57:59 +02:00
Mathieu Duckerts-Antoine d21634c394 [REF] web: 'web.Field' template
X-original-commit: 60c7b65f7f8efd5209b9fb0166a69035fb92e911
Part-of: odoo/odoo#102153
2022-10-04 20:57:58 +02:00
Mathieu Duckerts-Antoine c57f839721 [FIX] web: list: do not always keep offset
Have a list view with more records that can be displayed with the current
limit. Go to next page and group by some field that produces fewer groups
that the current offset. Before this commit, no group is shown because
the offset is kept when the list reload. The same thing can happen when
the domain is changed.

We fix that bug by setting the offset to be zero when the list reload.

closes odoo/odoo#101975

X-original-commit: bda0bd21c8e6772cbfb0680a2b8b497dbbcfd628
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-03 18:20:03 +02:00
Mathieu Duckerts-Antoine b6a0e89371 [FIX] web: list: care about allow_order option
Some overrides of search might allow to sort on non sortable fields like
my_activity_date_deadline on crm_lead. An option allow_order was used
to indicate that to the legacy list view. The new list view introduced
with https://github.com/odoo/odoo/commit/bc0a0cead62edd1e0b299fb9a90cd21792814618
no longer consider that option and consequently the Pipeline list view
of crm can now longer be sorted by my_activity_date_deadline. The same
happens in some other views.

In this commit, we reintroduce the use of that option in the list view
and fix that problem.

closes odoo/odoo#101837

X-original-commit: 52481d55ef857ffc1004d27216cbf6b81a527b14
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-02 13:11:47 +02:00
Mathieu Duckerts-Antoine fecde580d5 [FIX] web: tree found in action views
Before this commit, open an act window action asking for a tree view
would cause a crash. We fix that.

closes odoo/odoo#101831

X-original-commit: fa6fd8b079ad3347f3571654f07bf9751834654d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-01 17:04:48 +02:00
Mathieu Duckerts-Antoine 48801a0d40 [FIX] web: graph: use attribute order
For now, the graph view completely ignores the order attribute set on
its arch root node if written in the correct way, i.e. with "asc" or
"desc" (lower case). We fix that.

closes odoo/odoo#100302

X-original-commit: 0fb64bef16914937cf4a1d1618fb58ade6d16f14
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-09-15 20:17:54 +02:00
Mathieu Duckerts-Antoine 774aaa4984 [REF] *: remove legacy graph and pivot views
Now that web_studio no longer uses the legacy graph and pivot views and
that all their extensions have been converted, we can finally remove
them from the code base.

closes odoo/odoo#99734

Related: odoo/enterprise#31112
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-15 19:20:53 +02:00
Mathieu Duckerts-Antoine 505c7c1582 [IMP] web: a prop env for ComponentWrapper
We make this change to allow studio to pass a proper env to a new view.

Part-of: odoo/odoo#99734
2022-09-15 19:20:53 +02:00
Mathieu Duckerts-Antoine a0484895e1 [REF] web: view_service: ViewDescription type
Part-of: odoo/odoo#99734
2022-09-15 19:20:52 +02:00
Mathieu Duckerts-Antoine 2156805f27 [FIX] web: kanban: quick create in legacy dialog
When one tries to quick create a record in a kanban view column and a
rpc error occurs, a form view dialogs open. If the form view to
display in the dialog is a legacy view, save the record displayed in the
dialog make the kanban renderer receive a legacy datapoint with no resId
key, making impossible to add the appropriate record to the column.
We fix that.

closes odoo/odoo#99294

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-08 00:12:44 +02:00
Mathieu Duckerts-Antoine c4067108d5 [FIX] web: kanban: quick create in a dialog
Go to eLearning > Courses > Contents, group the kanban view by Course,
then quick create a record in a column. A form view dialogs opens. Save
the record: a crash occurs.

Root cause: the kanban view needs some record data that are not found
on the record created by the form view dialog but tries to add that
record directly to the column.

Solution: we create a totally new record with same resId and add that
new record to the column.

Part-of: odoo/odoo#99294
2022-09-08 00:12:43 +02:00
Mathieu Duckerts-Antoine 122190b31b [FIX] web: lower precedence for globalContext keys
Go to Project -> Reporting -> Timesheets and Planning Analysis and
select other measures in the pivot view via the "Measures" menu.
After that create a new favorite.

Result: the favorite is saved with the correct measures but the
pivot view will never use those measures. This is due to the presence
of the key "pivot_measures" in the action context.

(Note that the same problems occurs with other keys and other views)

We fix that problem by giving less precedence to keys in action contexts
with respect to those found in the search item contexts as it was
originaly the case in legacy views (cfr. __get method in action_model.js).

opw-2945969

closes odoo/odoo#99631

X-original-commit: 4528f562923cd0524f257f3a9c1ecd0002fd49b7
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-06 21:24:10 +02:00