Opportunity is taken to clean the various follow/join/invite methods into only
one `add_members` method.
Part of task-2360169
closesodoo/odoo#74425
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The readonly would not clear the old content when new content was put
through an onchange.
closesodoo/odoo#74476
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
With this commit: we remove click event from attachment_image widget, this is
specifically done so that when user clicks on kanban cover image kanban record
is opened, actually kanban record global click check if any of the child has
click event then it does not open on click.
task-2524022
closesodoo/odoo#74383
X-original-commit: a46b9ac37a0121102ddab44eca5ba6d6be82cb80
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
before this commit: when deleting or archiving or unarchive all records of last
page in listview user is displayed with NoContentHelper while we still have
other records in previous page, user should be moved to previous page if all
records of last page are deleted.
after this commit: if user deletes or archives or unarchives all records of
last page in list view then user is moved to previous page.
task-2446911
closesodoo/odoo#74091
X-original-commit: cead08fe6876239d1260b40948fcd74069496a2c
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Currently, When the One2many list contains a large amount of fields and the
user clicks or resizes the header, list takes table width as its initial width
and because of this list to overflows outside of the form view.
Issue raised after commit: d58edef12a
after this commit, clicking or resizing the list header does not impact the
width of the list.
TaskID-2388582
closesodoo/odoo#74277
X-original-commit: a145e1242118d3e539790327221486e1bd94e59a
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
The frontend code was still using the legacy RainbowMan, with the wowl
webclient, we rewrote this RainbowMan and started using that one
instead, but because the frontend code had no access to the wowl
environment, the legacy version was still used in the frontend. Since
the frontend now has access to the wowl environment, the old code can be
removed and the calls can go through the new effect service.
closesodoo/odoo#74148
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, it could happen that the test fails.
We may be waiting too long on the second click in the test and so
the form switches to edit mode too early.
Now, we don't await the click to keep sync.
closesodoo/odoo#74157
X-original-commit: 01708583777cf33e9b505a494fdc5cdb66db86b5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit: when standalone label is rendered in form view class
o_form_label_empty is not added due to which label text is not muted.
After this commit: when standalone label is rendered, label is sometime
rendered before field widget is rendered due to which o_form_label_empty class
is not added to label, with this commit we postprocess labels so that
o_form_label_empty is added on all field labels.
Also with commit, signature widget's isSet method will return true if value is
set in signature widget, this will make label of signature widget muted if it
is empty and form view mode is readonly.
task-2523197
closesodoo/odoo#71322
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Before this commit: remaining_days widget is not editable and it just shows
information based on value like, Today, Yesterday, Tommorrow etc, when we
change mode to edit it should have date/datetime picker so that user can change
value of the widget.
After this commit: remaining_days widget will display date/datetime picker in
edit mode and in readonly mode it will display delta between the value of the
field and today, it will also support edition of date/datetime value in multi
edit mode.
task-2507961
closesodoo/odoo#70578
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Currently, the time in popover of the year view does not appear
with the title due to record.allday is undefined instead of false
So in this commit, check if record.allday is not exist then display
the time infront of the title instead of after the title.
Related enterprise PR: https://github.com/odoo/enterprise/pull/19134
closes odoo/odoo#72440
Closes: #72440
Taskid: 2502339
Related: odoo/enterprise#19134
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
When dragging out the last record of a filtered column, its filter is cleared and the column is reloaded.
Taskid-2454209
closesodoo/odoo#72755
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
BEFORE
Various scenarii leads to inconsistencies on the progressbars when a filter is activated:
- when dropping in a non matching record
- when the view domain is updated (e.g. from some input in the search panel)
NOW
These scenarii works fine.
Taskid-2491196
Taskid-2454209
Add HTML fields support to kanban view (currently bespoke but maybe it
should be done via `format`), and remove t-raw for HTML fields there.
Also just strip some t-raws which were completely unnecessary to start with
Descriptions which need to use markup should be explicitly marked as
such. Update examples test to check that both Markup and String
descriptions work fine.
`escFormat` had to be modified quite a bit and ended up requiring
being its own Markup-adjacent type: if the `sprintf()` result is wrapped
in a `Markup`, then what happens is we first decide to escape because
the object returned by `escFormat` only has a `toString()`, then that
blows up because `toString` returns a non-primitive object and the
regex used to implement `_.escape` is very very unhappy.
`escFormat` could return a `Markup` object but then it wouldn't be
lazy anymore which would rather miss the point.
Therefore implement `[_.escapeMethod]` on the thing, such that it
doesn't get escaped, because it's safe (ish).
Also as a result the icons probably don't need to be markup-ed. Oh
well shouldn't really matter.
A note concerning the attributes which I will probably need to take a
look at in the vdom version: the Python version has to process attf in
order to stringify individual elements, and separately stringify the
attribute value so it gets forcefully escaped even if it's
markup-safe (because markup-safety and attributes-safety are
different).
The first should not need to be performed on the JS side, because
Markup can not overload addition, therefore in JS String + Markup is
String whereas in Python it's Markup (and the String gets forcefully
escaped). In general, js!markup is currently much simpler than
py!markup, both by necessity (can't overload operators) and
simplicity (we might want to overload some of the operations
e.g. String#replace, but that's complicated and it's not been strictly
necessary for now).
Also wrt Markup / _Markup: `class` ctors can only be invoked with
`new` meaning they can't be used as template strings or regular
functions. Here `class` is useful to avoid the mess of calling the
super's constructor explicitly (which may not even be possible for
`String`), however it means we need a facade function to support our
use-cases.
Also update `utils.sprintf` to be Markup-aware: if the format string
is a Markup object, interpolated values get automatically escaped (if
necessary) and the result remains a Markup object.
If we need to perform explicit instance check we can always set
`Markup.prototype = _Markup.prototype` (I think), however in theory
that's not necessary: there are protocols in place for the relevant
pseudo-escaping operations and they ought suffice.
qweb/js divergence from qweb/py
===============================
Unlike qweb/py, qweb/js will *not* return a Markup object. That is
because in js a primitive `string` and a boxed `String` object don't
match when typechecking, and while `markup instanceof String` passes,
`typeof markup === 'string'` does not.
The overwhelming majority of string typechecks are the latter: there
are all of 6 `instanceof String` in the entire codebase, all in
dependencies, while there are hundreds of `typeof $X === 'string'`,
several of which get fed the output of template rendering
e.g. `jQuery.parseXML` or `AbstractView#init` (some widgets will
render a template then use it as the `arch` of a subview, so
`viewInfo.arch` can be the output of a qweb template rendering). This
makes for very annoying and somewhat gnarly debugging.
Plus jQuery in particular really doesn't like being fed a boxed
String, as it will interpret said boxed string as an array, and assume
it's an array of DOM elements to wrap, leading to a rather strange
jQuery object as output. Since feeding the result of a template
rendering to jQuery is a major use-case in non-vdom widgets... that's
a bit of an issue.
For the same reason while `_.escape` is `Markup`-aware, unlike
`markupsafe-escape` it does not *produce*, though it is
`Markup`-transparent.
Purpose
=======
If the counters are enabled, this could lead to inconsistent counts,
as the session context (with allowed_company_ids) is not passed, and the
multi-company rules are not applied properly if we fall back on another
company that the ones on which the user is logged.
In previous commits, all references to the legacy notifications and
notification service have been removed, this commit removes the now
unused legacy notification and notification service
Part of #72675
When writing the new webclient, the notification service was rewritten,
and all of its uses in production code were changed to use the new
services, however, some tests were still reliant on the old notification
service.
This commit removes references to the legacy notification service so
that we can be one step closer to removing it from the code base.
Part of #72675
Bug
===
Since cc67988241 a new option is available
for the reference widget.
When the new option "model_field" is used on a reference field in a list
view, after saving and then editing, we need to change the model to be
able to select the records
Links
=====
Task-2127615
See odoo/odoo/pull/46304
See odoo/enterprise/pull/7701
See odoo/upgrade/pull/848
closesodoo/odoo#46304
Related: odoo/upgrade#848
Related: odoo/enterprise#7701
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In the case we have a legacy dialog calling a new dialog,
tabindex set on the legacy dialog prevents the new dialog
to get focused as well as its children.
Because of this, we cannot select text or focus text input/area
in the new dialog.
closesodoo/odoo#73639
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
before this commit, the name of the event and hour is not
correctly centered while dragging the pill in month mode.
This commit fixes the issue by adding the CSS property.
after this commit, the name of the event and hour should be
correctly centered while dragging the pill in month mode.
TaskID-2506060
closesodoo/odoo#73553
X-original-commit: 59156daa150bf285626600f0a999dfe9838e1344
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
- Install Sales > Configuration > Settings and activate Delivery Methods
- Create a SO as followed:
* Add a section (i.e. Section 1)
* Add a product (i.e. Product A)
* Add a product (i.e. Product B)
* Add a shipping (i.e. Delivery X)
* Add a section (i.e. Section 2)
* Add a product (i.e. Product C)
- Move (drag & drop) Delivery X to the first place
SO lines are reordered, but Product B is moved after Section 2.
It comes from the fact that some lines have the same sequence and that
only the lines between the source and the destination position are
re-sequenced.
Before the move, the sequencing is as followed:
1) Section 1: 10
2) Product A: 10
3) Product B: 10
4) Delivery X: 11
5) Section 2: 12
6) Product C: 13
After the move, only lines from 1 to 4 are re-sequenced. Leading to the
following sequencing:
1) Delivery X: 10
2) Section 1: 11
3) Product A: 12
4) Product B: 13
5) Section 2: 12
6) Product C: 13
As Product B has now a greater sequence than Section 2, it will be moved
after it.
If some lines between the source and the destination position have the
same sequence, all lines should be re-sequenced to prevent such a behavior.
opw-2531524
closesodoo/odoo#73456
X-original-commit: 8f64ac8ff2b94b66a8d8e94a8635727d0d53ca6b
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
Currently, the optional field's dropdown displays outside of the form view when
columns are expanded. it happens because the left css property is applied when
the column is expanded.
This commit fixes the issue by applying the correct css property after this
commit, the optional field's dropdown should always be positioned on the
right side of the list in ltr mode.
closes#69727
TaskID-2510187
closesodoo/odoo#73411
X-original-commit: bbc338438518bbb7d0e9ad1a313e872f95a36870
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Before this commit: when clicking on an editable state_selection widget in
listview, the dropdown is not displayed. this is happening because overflow
of cell was hidden.
After this commit: when clicking on an editable state_selection widget in
listview, the dropdown is displayed. change overflow to visible for
state_selection column. Also fixed the issue when selecting option from
state_selection widget row was get edited or if it is not editable listview
then view is swithed to form view, it is because of event propagation which
we stopped here.
Task - 2485883
closesodoo/odoo#68129
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
before this commit: if user enters some random value in daterange widget and
click outside the daterange field it throws traceback while it should not throw
traceback, it should only warn user that you are entering wrong value.
after this commit: if user enters some random value in daterange widget then it
will show warning toaster that you are entering wrong value.
task-2410523
closesodoo/odoo#73366
X-original-commit: 588d133f3daf28e0ce69052ae57ad89c5a96eb3a
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
before this commit: create_text was passed in node options and due to which it
was not parsed by translate.py, pass add-label as attribute on field so that
translate.py parse it and it is translated.
after this commit: create_text will be passed as field attribute instead of
node options.
task-1923433
closesodoo/odoo#59713
Related: odoo/enterprise#19418
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Before this commit: When there are no columns in kanban and user is
creating very first column then it will display column + examples
clicking out closes quick create of column and due to which mockup
column also disappeared.
After this commit: Quick create of column will not discard if there
are no columns and user is creating very first column, clicking
outside will discard quick create of column if there is atleast one
column exist.
task-2517684
closesodoo/odoo#70220
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
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>
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
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.
* 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).
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: 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>
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, 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>
There is a function allowing to close the quick create if we click outside the element.
`RecordQuickCreate._onWindowClicked`
Except that this function is triggered in a "click" event, so if we click on the quick create element and drag the mouse outside, it will detect that we are outside and close the quick create.
This manipulation can happen when you want to select text with the mouse.
This PR prevents this behavior by detecting when a click is from the quick create
opw-2558932
closesodoo/odoo#72279
X-original-commit: 75538bf2a36aa91df8b183ac21ae99a174e1c2fa
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
Before this commit, fields in calendar popover were added
to the $fieldsList after they were appended but appending
is async and so fields could be disordered.
Now, we add fields before the append to have the right order.
closesodoo/odoo#72262
X-original-commit: da1b85d2fdff85bee35d183a8ee4faa0897dc1b4
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Michaël Mattiello <mcm-odoo@users.noreply.github.com>
Previously, we removed the crash manager and moved its responsibilities
to the error service.
Because the crash manager was used in both the frontend and backend, and
because the infrastructure code required to use the error service in the
frontend hasn't been written yet, the crash manager has been moved to
the frontend assets where it is still needed in the interim. Most of the
logic of the crash manager has been moved to public_crash_manager (as it
is now the only crash manager and it doesn't make sense to keep the
inheritance hierarchy).
References to the crash manager in the backend were adapted where needed
or removed where they were no longer useful.
closesodoo-dev/odoo#943
Related: odoo-dev/enterprise#174
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>