This commit handles 2 things:
1) the merging of the `py_utils.context()` into the evaluation context
returned by `BasicModel._getEvalContext` to access the same time-related
keys,
2) the addition of 2 new keys into the `py_utils.context` (thus
transmitted to the basic model): `today` (an alias for the already
present `current_date`) and `now` which represents the current date and
time value.
Task 2269697
Commit [1] introduced the bug by relying on the fact an element with
id=top is in the edited DOM. As the website header can be disabled, this
induced a crash as soon as the header was indeed disabled. Also, the
editor is not meant to edit the website only so we cannot rely at all
on the presence of a #top element.
[1]: https://github.com/odoo/odoo/commit/6df67a28c2f113572acd4a3db19ab6b1bd37e7daclosesodoo/odoo#54409
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, defining a extension of a template by using the
combination of directives 't-name' and 't-extend' ignored potential
extensions that could have been defined beforehand.
For instance, let's assume the following templates.
```xml
<t t-name="a">
<div><span>1</span></div>
</t>
<t t-extend="a">
<t t-jquery="span" t-operation="replace">
<span>2</span>
</t>
</t>
<t t-name="b" t-extend="a">
<t t-jquery="div" t-operation="append">
<span>b</span>
</t>
</t>
```
Rendering template "b" displayed "1b" whereas we would expect "2b".
Moreover, when the extended template is itself an extension of
another template:
```xml
<t t-name="a">
<div><span>a</span></div>
</t>
<t t-name="b" t-extend="a">
<t t-jquery="div" t-operation="append">
<span>b</span>
</t>
</t>
<t t-name="c" t-extend="b">
<t t-jquery="div" t-operation="append">
<span>c</span>
</t>
</t>
```
Rendering template "a" displayed "a", template "b" displayed "ab",
but template "c" displayed "ac", whereas we would expect "abc".
With this commit, other extensions done to a template are kept when
a new extension is defined. It relies on the templates order, and
takes into account all extensions that have *already* been defined.
This is exactly how the new qweb inheritance mechanism (using
't-inherit' and 't-inherit-mode') behaves.
closesodoo/odoo#54315
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
*mail,point_of_sale,web_editor,website
In the tests, required services are deployed for each test
independently. There is no need to have, in additon, all services
deployed globally. Worse, it could conflict and lead to unexpected
results.
This commit ensures services are no longer deployed globally in
tests. It turns the module 'web.env' into a declarative module with
no side-effect, by moving the service deployment to main.js, which
isn't added to the tests page.
Task 2287397
closesodoo/odoo#53817
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Support for the "allow exports" group was implemented by checking the
group in init(), which is sync. Move that check over to willStart
instead.
Also add a default mock for user_has_group (makes it so it always
replies that the user doesn't have the group), and override that
specifically for the group we're interested in in the export tests, so
those tests have access to the Export action / option.
closesodoo/odoo#54254
X-original-commit: 30968ac93373990338c23f49e678d272b8e60c6b
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Issue
- Install Employees & Dashboard
- Add employees to kanban
- Dashboard
- Hover an employee picture
There is only the picture visible
on the page, the remaining space is white.
Cause
I found several issues.
1. The pictures are not shown on hover in employees
But they are on dashboard.
2. $attach = all `.content` and on dashboard there is
2 `.content` so the flyout is append 2 times
3. The move method is trigerred on hover too, it hides
the flyout if we are not in it. But with attachToTarget
we are not in it so it's hidden all time.
4. If everything above is solved, the image is shown but
not at the correct position because the flyout base
position is not top 0, left 0
Solution
1. Reduce the minimum required size to 128px
2. use closest instead of parents
3. Don't hide if we have the option attachToTarget
4. Calculate the flyout offset and replace it correctly
and set it to position fixed to handle scrolling
OPW-2291493
closesodoo/odoo#54333
X-original-commit: 2c6d692ee40c97d2ae63da64db7623702948407e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Issue
- Accounting > General ledger
- Have 2-3 lines in the table
I added filters to have them
- Toggle optional columns: (...) on the right
There is an y scroll but you can't scroll
more than half of the scrollbar.
Cause
The cause is that the dropdown height is greater
than the table height.
Solution
Use data-display: static this way the element doesn't
scroll with parent scroll and scrolling is working
as expected on the dropdown
OPW-2291531
closesodoo/odoo#54320
X-original-commit: 9afd7b7ec7461a47ea8d7fbbd4884c24e1af9865
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
*: web, web_editor
Instead of three lists + one map to define font information and user
choices saved as the index of the related fonts in those lists, the
fonts are now stored in an unique map <font-name> -> <data> and the
user choices are saved as the font name. This allow to have a visually
better definition of the fonts and allows to reorder fonts in the UI
without losing user customization (and actually simplify some code).
Unfortunately any user font customization < 14.0 will be lost, but this
is a small price to pay (users can still rechoose the same font in the
editor UI where they will go anyway to discover all the new shiny
features we are introducing there).
Part of https://github.com/odoo/odoo/pull/54065
task-2291398
closesodoo/odoo#54065
Related: odoo/design-themes#269
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
There are orm models that don't have _rec_name defined. The orm doesn't
allow creation of record via name_create if _rec_name is not defined in
the model. This commit considers this fact, such that if name_create
returns false, we don't proceed on displaying the non-existing record.
Note: _rec_name defaults to 'name' if not specified so only few models
don't have _rec_name.
closesodoo/odoo#54270
Task-id: 2285036
X-original-commit: 676c2b8e4fdf7347d44bc5afb7ca51d39338a527
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Adjacent buttons are not displayed in a single column. When the
table overflows, we try to squeeze largest columns to make it fit
into its container (in this case, text may be clipped and an
ellipsis is displayed). Button columns didn't get away from this.
As a consequence, now that a cell may contain several buttons,
some of them may be clipped and replaced by the ellipsis, which
isn't what we want for buttons.
This commit removes the button columns from the list of columns
to squeeze, so we let the browser reduce them as much as it can,
and we keep them as they are.
Task 2282470
closesodoo/odoo#54258
X-original-commit: e00960daa3ed3d1fd3a7572b2acedd3d2fb0448e
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Prior to this commit, the autoscroll on drag feature was accessible and only
used in the web_editor application.
After this commit, the autoscroll on drag feature will be available in the
web application and has been refactored in order to allow its usage
in other application (as for the sign application).
task-2280965
closesodoo/odoo#54072
Related: odoo/enterprise#11656
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Issue
- Install eCommerce
- Modify a product image with one which
has more than 1024px width/height to
enable zoom (I used: https://bit.ly/2VETQZS)
- Go on the website preview & hover the image
Depending on the screen size, a part of the
flyout is hidden because of overflow-x
if you want to see it, you should scroll
right width right arrow key.
Cause
The flyout has 100% width and is put
right (position absolute, left: 100%)
Solution
To avoid this error on all screen size,
the solution is to compute the max-width
of the flyout depending on the available
space on the right.
OPW-2283648
closesodoo/odoo#54222
X-original-commit: c89b4c25ed92542f6fd0279cf3a9e4ef1bac9fa5
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Before this commit, in a grouped kanban view with sample data (e.g.
crm.lead), one could toggle the 'settings' dropdown menu of a
group, and then drag&drop the group by clicking on the muted "Fold"
item in the dropdown.
After this commit, dragging a column is only possible by clicking
on the column title (but not on the 'config' or '+' icons, nor the
config dropdown).
Task 2290197
closesodoo/odoo#54179
X-original-commit: 58c38a024c96eba3469c142a8422b7bd0ab54ea4
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, there were a few tests in the "sample server" suite
that asserted that every group resulting of a "read_group" would contain
at least one record, while there was actually a slight chance of it not
happening.
Now, the sample server used in the tests has been rendered deterministic
and these kind of issues are completely avoided.
closesodoo/odoo#54164
X-original-commit: a6d32ff46558b68ce3f19458f29c311ee5c658fd
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Before this commit, boolean fields (without widget="boolean") in
kanban views were displayed as [Object object], because when no
widget is specified, we display the (textual) formatted value of
the field. However, the boolean formatter returns by default a
string encoding an html checkbox.
This commit passes the correct option to force a string formatting,
so it now displays "True" or "False". Moreover, this commit
uniformizes formatter options for that purpose, as another option
had been recently introduced for monetary field.
Note that those options should not be necessary, as formatters
should always return text values (no html). But this is a larger
change, that we might do in the future.
Task 2280394
closesodoo/odoo#53937
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
*: website
The style to achieve the chess-like bg result was duplicated at many
places. The 'web' app was also actually using an image from the
'web_editor' app (we can live with it in stable as web_editor always
comes with web in auto_install but this was still a mistake).
closesodoo/odoo#54154
Also: fix some layout issue in the colorpicker widget.
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In case a field is limited to specific groups on the model, those fields
are discarded from `fields_view_get()` but can still be referenced by some
filters on the search view causing a traceback (see #53797)
Model:
```python
class MyModel(models.Model):
my_field = fields.Char(groups='base.group_system')
```
Search views:
```xml
<search string="My Model">
<filter name="group_myfield" context="{'group_by': 'my_field'}"/>
</search>
```
This commit ensure those filter are correctly discarded.
OPW-2284621
closesodoo/odoo#54112
X-original-commit: b3452a1863c36290b13e16161e2703d9a3737f0e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Some widgets allow the edition in readonly (e.g. boolean_toggle,
priority...). In this case, the changed value is saved directly.
Before this commit, this didn't work in (main) list views: the
widget was updated with the new value, but it wasn't saved in db,
so the change was lost at reload.
This was due to the list controller not being correctly aware of
its mode ('edit' or 'readonly'), on which the basic controller
relies to determine whether a change must be saved directly or
not.
With this commit, a list is always in 'readonly', except when a
row is being edited, in which case it is in 'edit'.
Issue reported on task 2288963
closesodoo/odoo#54075
X-original-commit: 64e55cb42163643386740fbd23d710f64033b2ae
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
During TempusDominus autobinding to fields matching its default classes
(like `.datetimepicker-input` used by our DatePicker widget) and no
config was previously provided to the library (like when we disable it
on mobile), an unsafe access to the config's `_options` property results
into an error as the config is `undefined`.
This commit fixes it by first checking for config existence before
attempting to access its property.
Note: as this is a fix inside a library, a comment is added to make
clear. Also similar fixes where already done in the same file.
opw-2242880
X-original-commit: fe1f7c3e361bbd249b4025a464c546f478b6e989
This commit extracts the DatePicker widget's input setter to allow
overriding it and preventing from calling the `datetimepicker` lib when
not initialized (like on mobile).
Note: this change will be used on enterprise.
opw-2242880
X-original-commit: c0413868a8728500c52b7e1dd9a0035f90b654fd
Since the refactor of the control panel, support of "widgets" attributes
in the search view archs has been inadvertently dropped.
Now, they are once again supported.
Task 2061795
closesodoo/odoo#54066
X-original-commit: f33b0bc7a93e60bd0ed00b40d7459225ec0b749a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
In the search panel, the categories, i.e. fields select="one",
with attributes expand="0", and enable_counters="0" (defaults) were not
correctly updated when the domain outside of the search panel was
updated. This is no longer the case.
closesodoo/odoo#54040
X-original-commit: 99e9cac63f5034c1ba2154779fe82170dd656236
Related: odoo/enterprise#11642
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Problem:
Go to the application apps, select accounting in the search panel,
then filter on lunch in the search bar: the category all is displayed
as selected in the search panel (accounting is no more a valid value
since expand="0") but the application lunch does not appear in the
kanban view.
Root cause:
The kanban model is reloaded with the old domain using accounting
without waiting the search panel to be reloaded but it is only known
after the search panel has been reloaded that the accounting value is no
more valid and that all should be selected instead of accounting, thus
that the domain used by the kanban model should be updated.
Solution:
The solution to the problem is simple: first reload the search panel,
then reload the view model with the updated domain.
X-original-commit: 8589babcd0f2c15433fe1eb06d0d745e80d01c22
- Activate more than one language
- Install sale_quotation_builder
- Create a new quotation model without website description
- Create a SO using this model, Save
The 'Please update translations of' is displayed for the website
desctiption, although it is empty: when clicking on the link, no record
is shown.
This happens because an empty HTML field always contains at least
`<p><br></p>`.
We do not consider the latter string for translation.
opw-2274203
closesodoo/odoo#54025
X-original-commit: aad4d516b6fb4b286f24bc536e5ecb67558a0c4d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Before this commit, when the same field occurred multiple times in
a form view, all occurrences were associated with the same id, and
all occurrences of the corresponding label (if any) had the same
'for' attribute. As a consequence, besides the fact that there were
warnings in the chrome console, clicking on any occurrence of the
duplicated label focuses the first occurrence of the field.
This commit generates a unique id for each pair label/field, when
possible. However, there is a case that can't be handled
automatically: when the label isn't automatically generated (field
located outside a group, or with nolabel attribute set to "1").
Typically, in this case, there is a <label> node with "for"
attribute referencing the associated field. In this situation, the
id must be defined in the arch, and used in the "for" attribute:
<form>
<label for="phone"/><field name="phone"/>
<label for="phone_2"/><field name="phone" id="phone_2"/>
</form>
Task 2261697
Steps to reproduce:
- install website, website_mass_mailing
- go to website, edit and add a popup window (you should see warning banner stating
that a newsletter popup is present on this window). Save.
- go to settings > languages > load a new language (fr_FR for example) and translate
the website
- go back to the website > select the new language > click the TRANSLATE button
Previous behavior:
the warning banner is not editable, also click the "Edit popup" button does nothing
Current behavior:
clicking the "Edit popup" button triggers an alert with
a quick explanatory text
opw-2280188
closesodoo/odoo#53988
X-original-commit: af57e4924dbd432f9362881dae71d2a4e4595a1f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
*: web_editor
Do not display the backdrop element added by bootstrap in the body and
add a background on the modal to keep the same effect. The bootstrap
backdrop was probably useful for compatibility with <IE9 but is no
longer needed. This also avoids z-index issues because modals could be
opened in an element (e.g. the website #wrapwrap) whose stacking context
is different of the body one (where the backdrop is opened). This would
make the backdrop appears on top of the modal.
Part of https://github.com/odoo/odoo/pull/49142
Related to task-2229551
Co-authored-by: qsm-odoo <qsm@odoo.com>
* Improve layout of access error messages from group restriction
* Improve layout of access error messages from security records rules
* Use the error title in the js crash manager when possible
* adapt unit tests
closesodoo/odoo#50369
Taskid: 2206787
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The on_attach_callback methods on the widgets (comming from a tag
'widget') of a form renderer were not called at an appropriate time.
They were not called at all or called before the widgets were actually
in the dom. This was made manifest in the dashboards that generally use
pie charts widgets. Each time a pie chart widget is renderered,
a new canvas with a unique id is created. The above mentioned problem
explains why Chart.js was not able to acquire the canvas contexts: they
are obtained by looking for a specific id in the dom.
The present commit fixes that problem by doing in the class FormRenderer
what was already done correctly in the child class DashboardRenderer and
remove the unapropriate calls to on_attach_callback in _renderWidget.
Task ID: 2278717
closesodoo/odoo#53853
X-original-commit: 7641c7074616b4375f1eb4f1fcb5a96e2ed39f94
Related: odoo/enterprise#11537
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, when a search_default on a many2one field tried to
update its label after a name_get, the value was set on its initial
associated query element which could have been erased by a default
favorite.
Now, the model determines whether there is a default favorite before
processing default filters, preventing any unnecessary RPC.
closesodoo/odoo#53840
X-original-commit: ff834d0ba6f9b7eadc23c28dbbf892eba2058583
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The do-action handler added was calling directly doAction method of
action_manager which lead to an issue in enterprise as the override
taking care of closing home menu in web_enterprise/do_action was no
more called. This commit fixes that by calling the do_action method of
abstract_web_client and thus the override to be executed.
Originally detected in task-2282273
closesodoo/odoo#53836
X-original-commit: 7949baf08b7e07cb5f25f1a42b4eb12ed3a65a64
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, when archiving a record through the action
menu, the 'Archive' link was not updated to 'Unarchive' and same
when unarchive was clicked, the link was not updated to 'Archive'.
After this commit, when archiving a record through the action menu,
the 'Archive' link is updated to 'Unarchive', same way when
unarchiving a record link is updated to 'Archive'.
This commit also introduces a new prop 'closeOnSelected' to the
Dropdown component, to specify whether the dropdown should be
closed when an item is selected, and makes Action Menu dropdown
closed on item selected.
task-2251739
closesodoo/odoo#53835
X-original-commit: dc5d02ade7747c74c31566c74932ef45c30e9356
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Steps to reproduce:
- Create a database with german as main language
- Load the en_US language (keep user preference as german)
- Activate debug mode > find the email template named "Purchase Order: Send PO"
- Edit the mail template > click the "DE" button to show thet translation dialog
Previous behavior:
the en_US translation is empty, it is confusing because the user assumes
that english translation have not been loaded.
that translation is actually fine when you switch to english
Current behavior:
en_US translations' empty value are assumed to be the same as the source
opw-2276673
closesodoo/odoo#53787
X-original-commit: 52975811071af3dbfe31d93b19f8a0f3a1b6b694
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
After changing the organisation of the test bundles, some elements seem
to have disappeared from most of the tests, leaving free space for other
undesirable elements to remain on the DOM after tests unnoticed.
Now, any element not allowed in the body or qunit fixture will be
properly detected and removed.
X-original-commit: 65da01e5b96ff77d25e4421d654585bc08e09d75
Currently, when kanban card drag and drop, it call onchange method
when onchange fails due to python error raised, e.g. UserError, kanban
view is not reloaded and kanban card stays in dropped column while
kanban card should come back to column from where it is dragged i.e.
kanban view should reload if onchange fails.
After this commit, if onchange trigerred from kanban drag and drop fails
then kanban view will get reloaded and card will come back to column
from where it is dragged.
note: in not stable version, forceFail option will not be added and
promise will fail in all cases but it is not done in stable for safety.
task-2267444
closesodoo/odoo#53695
X-original-commit: 27257d34c8b7374bfd8037de71f175f4ecb2913e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
In search view, the "invisible" attribute can use complex expression,
and so we must rely on the "modifiers" attribute set by the ir.ui.view
post-processing to determine if a filter should be invisible or not.
For example, considering the context {'hide_myfilter': False}, the
following view:
```xml
<search>
...
<filter name="myfilter" string="My Filter" invisible="context.get('hide_myfilter')"/>
...
</search>
```
Will be returned as such by the server:
```xml
<search>
...
<filter name="myfilter" string="My Filter" invisible="context.get('hide_myfilter')"
modifiers="{"invisible": false}"/>
...
</search>
```
After this commit, the filter "myfilter" will correctly be shown.
OPW-2243639
closesodoo/odoo#53690
X-original-commit: 00969326e24dadd9b3f6e026789a1e575dd1c8dc
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Xavier ALT <xavieralt@users.noreply.github.com>
Before this commit, the size of the form view was handled by a media query
It made testing impossible in certain case when the size determined the behavior
of the form view (the chatter)
After this commit, a class is put on the form view to better be able to test
task-2238141
PR #53136
X-original-commit: d42610297b46f4a1624df1907a9cce91de29fafa
When comparing time ranges in pivot, it makes more sense to display the
previous period before the one being compared. This commit allows that.
Task ID: 2269770
closesodoo/odoo#52746
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Co-authored-by: Priyanka Kakadiya <pka@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
On a re-render, when:
- a field is not yet started (still in willStart because of RPC)
- then an action is executed
we can get a traceback because we try to save the field before it is
started and `this.el` is not set.
eg. in MRP on a work order:
- click on + to get new serial number
=> page is re-rendered with RPC call to update duration to
mrp.workcenter.productivity().search_read to update time
counter
- click on "Record production" before RPC is finished
=> traceback because we try to save `duration` that is not already
started (`this.$el.toggleClass` when `this.$el` is `undefined`)
Without change, added test fails with:
"Cannot read property 'toggleClass' of undefined"
in BasicRenderer.canBeSaved
"Expected 6 assertions, but 5 were run"
Before saas-11.3 5faec34a3c this.el was always set in `init` so this
issue did not happen.
opw-2272117
closes#53532closesodoo/odoo#53612
X-original-commit: befcad51fd236fdaf284f76cea5624d21c070b0e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
A recent commit [1] made the daterangepicker automatically close
itself on scroll events. However, in firefox, a scroll event is
triggered when the daterangepicker opens. This event is triggered
inside the picker itself. As a consequence, the picker is closed
directly. This commit solves the issue by only closing it on scroll
events occurring outside the picker.
[1] https://github.com/odoo/odoo/commit/e6730c6e928587cd7438340cc101c57fee34220bclosesodoo/odoo#53497
Task: 2282571
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Since commit 042b4060bd, attrs 'column_invisible' on button was
ignored. This commit makes this work alongside the adjacent button
grouping feature: if all adjacent buttons have their attrs
column_invisible evaluated to true, no column is rendered for this
group of adjacent buttons.
closesodoo/odoo#53489
X-original-commit: 3110e34ab8e5ec3bf7160655af21f72b4d2179db
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This error occurs for instance when your session expires and you
reload. At this point, the hash part of the url is duplicated and
an error is raised when the webclient tries to parse 'cids' part.
The hash part of the url should not be duplicated, but whatever the
url hash, the client should not crash either.
This commit prevents the hash part from being duplicated, and the
client from crashing when there are several occurrences of 'cids'.
closesodoo/odoo#52599
Task: 2267401
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the calendar view showcases tasks by deadline. Because it is a simple date field, the day/week modes don't have much value and are even confusing to the users, who expect to be able to define timeframes.
In addition, the quickcreate doesn't allow to select a project. This is problematic because it leads to "ghost" tasks.
closesodoo/odoo#52478
Taskid: 2264594
Related: odoo/enterprise#10976
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Previous commit introduces the sample data feature in list and
kanban views. When sample data is displayed, most parts of the
renderers can't be clicked on, to prevent the user from interacting
with sample records (e.g. to open a sample record in form view from
the list). This commit disables keyboard navigation as well, as
those sample records could still be accessed with the keyboard.
To do so, several refactorings have been done in views:
- _giveFocus function added on controllers (so that we can hook
on the moment where we want to focus the renderer, and prevent
it in sample mode), it kind of replaces giveFocus of ActionMixin
which wasn't use from the outside
- updateRendererState -> _updateRendererState as it is private
- _setState function added on controllers, to have a hook when we
set a new state (already existed, but only in kanban)
- _renderView function moved from Basic to AbstractRenderer, so
that we have a proper hook to deactivate clickable elements in
sample mode
Task 2232801
X-original-commit: 4482a03fe2f083f4f44fc6eb76d90ae22afbff91
With this commit, it is now possible to display sample (fake)
data in empty views, in the hope of easing user onboarding.
This can be enabled (in list and kanban views) with attribute
sample="1" on the arch root element. In this case, if there is
no data to display, sample data will be generated based on
heuristics (depending on field types and names). This can be
used in addition to the no content helper.
Task 2232801
X-original-commit: 7c8e627ff5029cb539d702705e5ce53d658c76ed
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Jérémy Hennecart <jeh@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>