add resetLocalState method to rendererWrapper and test activity view is not
crashed on on_destroy_callback
task-2466057
closesodoo/odoo#73022
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
before this commit: when switching to form view from listview using Create
button and then activate some other tab and Discard that record which will
move back user to list view now again clicking Create button opens form view
but active tab is last activated form tab instead of first one, this is because
of local state is not cleared.
after this commit: when form view is switched back to list view using Discard
button, local state will be cleared, here we are explicitly removing 'active'
class from all tab and pages of all notebooks.
task-2466057
X-original-commit: ff0e5694e28a46287dc54ab440364e11e8e9c832
Currently, a traceback is generated on removing a groupby when line is in edit
mode in groupable list view. It happens because the facet removal and window
click both are called at the same time.
This commit fixes the issue by ignoring the window click on removing the search
facet.
TaskID-2518527
closes#70236closesodoo/odoo#73102
X-original-commit: da51bd7ef270fe5a481b937f0a3c296d0eea196c
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Go to User list
With studio add column User type
export
Traceback will occur because the special field sel_groups_*
should not be exported
opw-2565911
closesodoo/odoo#72861
X-original-commit: 196fe4c0be19310964b41da3b8a113f6d81aed6e
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
The #for attribute of the LABEL tag should match the #id of the INPUT
tag, not it's #name.
This regression was introduced in a171694644closesodoo/odoo#73052
X-original-commit: 979c9d71aee4b1bb6c8798bdfdbf69ac8af3fa69
Signed-off-by: Romain Tartière <romain@vittoriaconseil.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
before this commit: when user is in readonly form, hovering on color picker
widget show cursor pointer due to which user has impression that it can be
edited while color picker should display default cursor in readonly form.
after this commit: in readonly form color picker widget will display default
cursor while hovering over color.
task-2326198
closesodoo/odoo#73011
X-original-commit: a7663fd5c0bf9f09dbb7fa472b1cb0ef3aa47930
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
This commit adds a sum field description when hovering the quantity at the end
of a progressbar. The description is the label (translated string
representation) of the field used for the sum.
Task-ID: 2243913
PR odoo/odoo#69380
1. Objective
- We are in a Kanban view, and we group by a "date/datetime" field.
- In order to "quick create" a record in a group, or to "drag & drop" a
record between 2 groups, we need a default value for this date field.
- In this case, a group represents a "range" of dates. A default value could
be the last date of this range.
- Prior to this commit, the view had only access to a display string for this
date range. We want to have access to the concrete bounds (start/end dates)
- Since some date/datetime fields have backend constraints, it would be
difficult to generate a compliant global default value. As such, the use of
the default value should be disabled by default and activated on a field by
field basis.
2. Usage
- Use the last day (for dates), or second (for datetimes) of the range to set
a default value in kanban "quick create" and "drag & drop"
- Use the end of the range of the last group from a read_group to be able to
request the next group (chronological order) in subsequent read_group calls
3. What are the changes in this commit
- read_group from the "core" "models.py", with the added __range for
date(time) fields, a dictionary for each group. The keys are the field
names and the values are a dictionary with the following keys: value:
- from: starting date(time) of the range (inclusive)
- to: ending date(time) of the range (exclusive)
- XML changes:
- with a new xml attribute on <field> tag allow_group_range_value (for the
kanban view):
- we allow (or disallow) supported non-readonly fields to be:
- draggable
- quick created
- this attribute can be used only on date(time) fields, and if not set,
the default behavior is false
- the naming is subject to contention because it relates to
different features. The relation comes from the constraint:
To perform a drag&drop or a quickCreate, we must be able to get the
value from the group containing the record.
- JS changes:
- we add "group.range" after a read_group for date fields, which is a
dictionary: {field_name: {from, to}}, for each date(time) groupby field
- since date(time) fields can use the format "date_field:granularity" when
used in a groupby, we have to properly split out the granularity to ensure
compatibility with the code previously in place (drag&drop procedures)
- update mock_server and sample_server to make use of the date range.
Adding support for datetime grouping to both mock and sample servers, for
tests and previews.
- the default value for kanban drag&drop and quickCreate features is the
last day/second of the range for date/datetime fields
4. Why can't this range be computed from the original display value with
moment.js
The Babel python library that we use for date(time) formatting (2.6.0) is kept
at the same version as the package in stable Debian Linux. This version has
some issues with displaying weeks consistently around the new year in certain
locales.
We cannot reverse compute a date(time) label with moment.js to get a range since
nothing guarantees that the range will be the same one that Babel used to
output it.
5. read_group return format discussion
Prior to this commit, the format of the value for the groupBy field was
either :
- String : used as a display value for the group.
Most notably, for date and datetime, this value cannot be used as a field
value in most cases. It would be more practical to also return the date
range along with the display value, so that Drag&Drop and QuickCreate
functionalities can be properly enabled in views
example :
"March 2021" has the range ['&', (field, '>=', 2021-03-01),
(field, '<', 2021-04-01)]
This information is lost at the end of the read_group.
- Array : used to indicate a res_id in case of a many2one field
res_id = array[0]
field_diplay_value = array[1]
Since we cannot use the array format to send the date(time)s of the period range
because it could be confused with the many2one format, this commit introduces
the use of a new `__range` key which is a dictionary with specific related
keys to be used to defer usable data to the web client.
Task-ID: 2243913
PR odoo/odoo#69380
Before this commit, clicking on "Edit ControlPanelView" in the
debug manager actually edited the "main" view (e.g. kanban), because
we used the wrong view id.
This commit also renames "Edit ControlPanelView" into "Edit
SearchView", which is more accurate w.r.t. to the view type.
closesodoo/odoo#72995
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
html field allows to insert html structures that can be treated as elements of
odoo web client. This patch updates setLocalState method (part of the web
client) to check if an element is inside html field, so such elements will be
ignored
---
opw-2520403
closesodoo/odoo#72877
X-original-commit: d2733da4863bd03b0cf853355596a44e901405d2
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
A number of functions from `web.test_utils` have been deprecated at
the module root and should be called through submodules.
Fix a bunch of remaining cases. Also add a few missing `await`s on
`triggerMouseEvent` calls. Don't bother rewriting the imports in
unpacking style as for most updating the imports is unnecessary. Do so
for `field_one2many_tests.js` where we have to rewrite the imports
anyway:
* recursively import controlPanel, createView, mock.patch and
mock.unpatch
* remove the aliasing of controlPanel to cpHelpers
Can't have a searchpanel with both:
* a filter (`field[@select='multi']`) with a `@domain`
* *and* a category (`field[not(@select='multi')]`) with `@enable_counters`
That specific case will trigger a warning and the counters being
disabled. Fix them. Oddly enough the only cases seem to be in tests...
One of the qweb tests checks that in a t-set @t-value takes priority
over body contents. However this construct also triggers a warning
when invoked.
Mock out `window.console` during qweb tests, this suppresses that
warning.
This test sometimes fails locally.
Updating it to be a bit more modern also seems to make it more
reliable (also moved the delay between the drag & drop operation & the
steps checking as it seems more logical, but the reliability issues
had disappeared before that).
* Add test name when logging missing action ids, makes finding out
which test causes the issue much simpler.
* Suppress the warning emission in the one remaining test which
triggers it, as testing invalid action IDs is exactly the purpose of
the test.
Two internal warnings are features which literally are not (entirely)
implemented, the tests can't be fixed to avoid them. Also augmented
the log messages with which test triggered the log, as it's very hard
to debug the issue otherwise.
As for the qweb debug mode warning, there's no way to disable it
easily because multiple tours explicitly opt into debug mode (with
good reasons), so it's not enough to just bypass the `mode` setter in
the test setup helpers (test_main in POS and main_tests in web), there
would also need to be special workarounds in the 4 modules which set
`owl.config.mode` based on the session's debug mode.
I don't know that this warning is even useful, it defaults to `false`
so the only situation in which this would be relevant would be for a
third-party to use Owl *and* explicitly enable the debug mode *and*
forget to remove it when deploying to production *and* look at their
console.
* Without an explicit format string, moment() should be called with
ISO date(times).
* Correctly destroy all test locales (`zz` was not destroyed at all,
and `englishForTest` was double-destroyed instead of destroying
`frenchForTests`).
* Avoid creating a moment object from the value `false` in date(time)
fields.
* Disable the warning entirely in dates_tests, the contents are super
messy and weird.
Trigger a *lot* of spam while running tests
It's not great that this is now disabled:
* some cases are mistakes in the test e.g. RPC not properly setup,
they should really be fixed
* others are literally testing error responses, the logging should be
suppressed instead
Ideal scenario would probably be to upgrade this to `error` and have
an API of some sort to suppress it on a per-test basis (not unlike
`@mute_logger` on the Python side).
The error is (apparently) benign and already suppressed in some parts
of the system, however it can (apparently) trigger locally during some
tests, causing the test to fail as the error is caught and converted
to a failure by QUnit.
Sadly QUnit does not offer a proper hook for this, so it has to be
suppressed by wrapping the existing handler and only calling it for
other errors.
Before this commit: calendar view sidebar filter names were getting cropped
at bottom, it is because of line-height property which is set to 1.
After this commit: calendar view sidebar filter names will not be cropped
as line-height property set to 1.5.
task-2519813
closesodoo/odoo#72898
X-original-commit: 4e24df71f34f0306447f724fd5028778fdf46428
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
This commit adds the possibility to use a shortcut from the command
palette. When a shortcut is called from the command palette, the palette
will be close and the action related to the shortcut will be apply.
closesodoo/odoo#72831
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Since a recent commit[1], many2one field was improved, and the inner components
are now wrapped within a newly introduced div `o_field_many2one_selection`.
Reference field extends many2one field and due to newly introduced wrapper div,
few editable form view related css rules (mainly for `o_row`) were broken and
the referece field was a mess in editable form view.
This commit fixes the issue by adding reference field specific rules that
restores the UI in the editable form view.
This commit fixes the issue by adding the class "o_row"
on the <div class='.o_field_many2one_selection'> containing the <select>
and the <input>.
commit[1] - 288b24c
TaskID-2453138
closesodoo/odoo#72833
X-original-commit: 1f14652aca91763caf271c248c7576978671cfca
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, when browsing a filterMenu with the keyboard, the CustomFilterMenu
was not focusable. This is because its root node changed from `button` to `span` which is not
focusable by default.
After this commit, the CustomFilterMenu is focusable and the root node has been replaced back by a button
closesodoo/odoo#72738
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Before this commit: on smaller screens, in color field, colors are not display
in one line, few colors are coming on second line.
After this commit: colors are now displaying in one line by reducing margin
between color squares.
task-2454346
closesodoo/odoo#66915
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
This commit implements improvements in the layout designer, such as addition of a new custom background, adds custom report footer and company details.
task-2355704
closesodoo/odoo#66860
Related: odoo/upgrade#2275
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
before this commit: if all pages are hidden then notebook ul was still visible
due to which border for notebook ul element was displayed.
after this commit: if all pages are hidden then we hides notebook ul element
as well, so that we don't have empty border line of empty notebook.
task-2411651
closesodoo/odoo#63420
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
- Install the eCommerce (for the ribbon, in 14.0) and the Sales app
- Go to the Sales app -> Products -> Products
- (View List ->) select (a) Product(s) -> Action -> Export
- check "I want to update data (import-compatible export)" -> click on the "Ribbon" field (in 14.0, or another many2x field for wich the model has no _rec_name defined) to expand
Cause: the export page controller tries to access an undefined field (_rec_name)
Solution: the controller now uses a fallback method to retrieve the wanted field
opw-2566403
closesodoo/odoo#72748
X-original-commit: e31cb5be22de7db223318b4876bf725e15654fea
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: prro-odoo <proose@users.noreply.github.com>
Have something like:
```js
sprintf("my string %s", _lt("lazy translated"));
```
Before this commit, the lazy translated term was not formatted into the string.
This was because _lt returns an object containing a custom toString function, which was not handled by sprintf
After this commit, sprintf is able to handle lazy translated strings
closesodoo/odoo#72598
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, "lazy translated" strings were implemented as
objects with a toString function. This is simple, but does not emulate
very well the real behaviour of a string.
In this commit, we create a LazyTranslatedSTring class which subclass
the String class, so all string methods will work as expected.
We also expose the _t function here, to make it more convenient for some
code to access the translations instead of depending on the presence of
an environment.
Since odoo/odoo@1971bf3 the customised dropdown in the pivot view (the one that opens its submenus horizontally) cannot open at all its submenus.
As the correct behaviour cannot be restored without reintroducing the +300 scss lines that has been removed, this commit applies a temporary fix that *changes* the design of this dropdown. Now, its submenus will open vertically, like for the groupby menu near the search bar.
The final dropdowns design is currently ongoing within the taskid: 2578926
closesodoo/odoo#72640
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Stefano Rigano <sri@odoo.com>
Before this commit, the template of some dynamic classes (usually as WOWL to legacyAdapters)
were registered at each definition of the class which is potentially at every doAction/switchView
After this commit, they are all registered only once, as early as possible.
closesodoo/odoo#72476
Related: odoo/enterprise#19199
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Before this commit, when clicking on menus or debug items or use menu items
the URL briefly changed pushing an unwanted history entry.
We do want those to be links (tag `a`) with an href to be able to open in a new tab.
But we don't want the current url hash to change because of it.
This commit fixes this.
on a legacy form view, do an action in target new
The view in target new should, during its onchange, trigger a ValidationError
Before this commit, the dialog_container was stuck in an error loop.
This was because the received error was never an instance of Error, rather it was
a legacy error event. So it was never transmitted upstream were the ErrorHandler could remove
the dialog in error from is dialog array.
After this commit, the ValidationError mesage is displayed.
This commit additionally fixes another issue:
An action in target main that failed to render erased the whole DOM. This is not what we want,
at least for now. Imagine a list view, open a record, this record fails to load. We still want to be
on the list view, not in a blank state.
Before this commit, the error service bound its listeners onto window.
This may create pollution when executing more than one test instanciating an error_service
After this commit, we bind the handlers onto browser, which is fully in our control in tests.
Open a action in target new that you'll know will fail to open.
Make sure you put an onClose callback when executing doAction.
Open another action in target new, that will succeed.
Before this commit, the onClose of the first dialog is executed, while it should not.
Indeed, if the dialog fails, the whole business flow is invalid altogether
and no more business operation (in the onClose) should be executed
After this commit, the onClose callback of the failing dialog is not executed.
Before this commit, a traceback would occurs in sale_management calendar view when the user would try to display the popover of a sale_order.
```js
basic_model.js:2399 Uncaught (in promise) Error: for modifier "readonly": Unknown field state in domain
at Class._evalModifiers (basic_model.js:2399)
at calendar_popover.js:203
at Function._.each._.forEach (underscore.js:145)
at calendar_popover.js:180
at async Promise.all (index 1)
_evalModifiers @ basic_model.js:2399
(anonymous) @ calendar_popover.js:203
_.each._.forEach @ underscore.js:145
(anonymous) @ calendar_popover.js:180
Promise.then (async)
_renderEventPopover @ calendar_renderer.js:861
eventClick @ calendar_renderer.js:416
Calendar.publiclyTrigger @ main.js:6981
EventClicking._this.handleSegClick @ main.js:6462
realHandler @ main.js:385
```
It would happen because the domain of the partner_id is ["state", "not in", ['draft', 'sent']] but the state field is invisible="1" in the view.
state was absent during of the evalContext in the _evalModifiers function.
closesodoo/odoo#72617
Taskid: 2524993
X-original-commit: 0d636c0f8dbcfb4b7adda26c0edc02a12b0c7e44
Signed-off-by: Michaël Mattiello <mcm-odoo@users.noreply.github.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
Before this commit, the clickEverywhere test was run for the demo
user on all apps available for the admin. It thus crashed on the
apps that aren't available for the demo user.
closesodoo/odoo#72430
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Before this commit, when we wanted to select first level menus
inside an app (i.e. menus available in the navbar), we could by
mistake select sub-menus if the dropdown was opened (e.g. if it
was previously tested). For instance, it happened in the 'Apps'
app. It then led to wrong index computation, and a traceback. As
a consequence, the nightly build failed as the clickEverywhere test
didn't pass.
Before this commit, the "Edit View" debug item only worked for
kanban, list and form views. For the other views, it opened a
blank form view. The reason is that for the other views, it didn't
correctly get the id of the view to edit.
Bug reported in the wowl-bugs pad
closesodoo/odoo#72523
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit the doAction method of the action_service did not support
to pass props directly to the Component. Only a few ad-hoc options were passed though.
After this commit, doAction can take a key "props" in options, that will be passed to the Component
(a View or a ClientAction)
the new API becomes
```ts
interface Options {
props: { [key: string]: any };
...
}
doAction(action: ActionRequest, options: Options);
Note that some props (like withFilters) are set by the action service
and cannot be set via the key "props".
Alongside the change mentioned above, we take the opportunity to align the
terminology used in action service to the one used server side: we know use
the terms resModel, resId, and resIds instead of model, recordId, and recordIds.
```
closesodoo/odoo#72397
Related: odoo/enterprise#19127
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Before this commit, rainbowman message was displayed using
`t-raw` in template.
Now, the message is escaped by default and needs to be marked as
HTML to be displayed as well.
closesodoo/odoo#72392
Task-id: 2575435
Related: odoo/enterprise#19121
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
It seems some terms are no translatable so purpose of the task is
to find those terms ans update to make them translatable.
So in this commit, translate the text attribute when the node is field
tag and this node contains widget='url' in its attributes. and
also make the project name as translatable.
closesodoo/odoo#71406
Taskid: 2487710
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
Co-authored-by: xavierbol <xbo@odoo.com>
Before this commit, all actions, even those executed in target
"new" (i.e. in dialogs) updated the document's title. Actions in
dialog should not do that.
closesodoo/odoo#72526
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>