*: web, web_editor, payment
Before this commit, templates with %d was given to sprintf but it was not interpreted by the function
After the commit, %d are replaced by %s in templates for sprintf
Also this commit converts a last _.str.sprintf into sprintf
PR#120143
closesodoo/odoo#120143
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
This commit adds a patchDate to the "Several date filters and a comparison"
test. The patchDate will allow the date to be fixed and prevent the test
from being invalidated when the month changes in the real world.
closesodoo/odoo#120231
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Steps to reproduce
==================
- Use an IOS device
- Open a view with a float field
- Try to edit it
The virtual keyboard displayed is missing a dot, so you can only input
integers
Cause of the issue
==================
For fields that should accept a float value, the inputmode attribute
should be decimal.
Also, specifically on IOS, even with the inputmode set to decimal, it
isn't possible to enter a negative value.
> decimal:
> Fractional numeric input keyboard containing the digits and decimal separator
> Devices may or may not show a minus key (-)
Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode
Solution
========
For IOS, remove the inputmode attribute so that the default keyboard
shows. For other devices, use the decimal/numeric value depending on
whether a float should be accepted.
opw-3269275
closesodoo/odoo#120129
X-original-commit: fb37550715034e7a1fbe751889cd8ea2bd6e4128
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In commit 2ecfed335d, we made the decision
to pass the domain to the field during extracProps with a getter in dynamicInfo.
This strategy causes the domain to be evaluated for all fields using it
in their extractProps. Very often we want to evaluate the domain on
an event, for example when a m2o is clicked on. The permanent evaluation
when using the widget therefore implies an unnecessary computational cost
for the evaluation and prevents the use of field.domain as a default value,
as it may be present in readonly views which never need the domain to be evaluated.
We will therefore convert the getter domain into a function that can be
called when we need the domain to be evaluated. This allows us to avoid
unnecessary evaluations and we can use field.domain as the default value
in the dynamic.domain.
closesodoo/odoo#120061
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
DataURL returns 'data:' in Chrome for empty files which is not valid dataURLas
it expects 'data:<mimetype>;base64' . This DataURL method is used to obtain
base64 representation of the file data,. That's why the 'data' argument is
missing and error is being generated.
Steps to reproduce:
1) Open Notes and create a new Note in Chrome.
2) Add a new attachment using /image command.
3) Add an empty file.
By applying this,it will return proper format for empty file.
sentry - 3749971166
closesodoo/odoo#120060
X-original-commit: fd6b904a97e7dab6e720675d9c805ed45eacef1e
Signed-off-by: Samuel Degueldre <sad@odoo.com>
*: point_of_sale, pos_hr, pos_restaurant
Previously, the pos service started synchronously, but doing anything
meaningful with it needed to be done after it was "ready", meaning it
had loaded and processed the data. The reason for this is that we need
to start the services before we mount the chrome, but in the pos we want
to show the loader immediately while the data is loading. This means
that any service that depends on the pos service in a meaningful manner
has to be written in a convoluted way, where it starts as a dummy
service and then overwrites itself in the env when it's actually ready.
This commit allows to write services that depend on the pos service more
naturally, by making the pos service properly asynchronous, meaning its
dependents will only be loaded once it's actually ready. To work around
the loader issue, the loader is mounted as a separate owl appplication
with not services, this application is shown over the chrome and when
the chrome mounts, it hides the loader and destroys the loader
application after the fade-out transition.
closesodoo/odoo#119908
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
The "quick assign" feature introduced in 66321f7 can be a bit too
visible and distracting - it is after all a shortcut and should probably
not add a primary-colored button on all kanban cards it's used on.
This revision makes the quick assign shortcut only appear on a card
if it's hovered (always visible on mobile though).
ask-3292053
closesodoo/odoo#120035
X-original-commit: 198a498c83e37197a963bdb18a608834808cd096
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
Since https://github.com/odoo/odoo/commit/28e6b7eb83e4309c4e70974d947194bdca240865, the boolean toggle widget
trigger a save when the user clicks on it. This is a problem when the
widget is used in a form view opened from a o2m list, because the
record updated is saved immediately, even if the user clicks on the
discard button.
This commit adds a new option to disable the autosave on the boolean
toggle widget. To disable the autosave, add `autosave: false` in the
options on the field definition.
Task-id 3235962
closesodoo/odoo#120000
X-original-commit: b56e58dff3258698dbbf173bc6790a35a47131b0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Suppose a RelationalModel instanciating a record.
On this record, trigger an onchange adding a new line on a one2many field.
=> The values of the Command.create command is not parsed correctly.
Indeed, if your one2many contains a Date field, its value will be a string and
not a Datetime object as expected.
closesodoo/odoo#119928
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit aims to make the SelectMenu easier to use with a better
navigation system, and the ability to select a value with the enter
key.
The bottomArea slot no longer adds a div, which could allow to use
DropdownItems in this slot, and navigate fluently from other options.
Those improvements are required by task-3134491, which will replace
a select2 input with the SelectMenu instead.
Tests have been added for the navigation behavior and the selection
with the enter key.
closesodoo/odoo#119934
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When the user uploads a file the length of the list will return 1, but when
it tries to retrieve a file which is not in the list or wants to upload another
file while the process is ongoing it will throw a IndexError.
After this commit, the race condition is satisfied i.e. now the user will not
able to upload the file while the uploading is still going on.
sentry-3938949468
closesodoo/odoo#120012
X-original-commit: 482e0034e1a5882ea1e0bc4ddb56d8ef5f5a1a92
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Before this commit, when the user selects a kanban card with the arrows
key navigation in the project/task kanban view, the focus will be on the
first `button/a` element found in the kanban card and so it could be
something else then the classic global click (when the user clicks on
kanban card).
This commit changes the focus to first select the element containing
`oe_kanban_global_click` to click on. If no 'oe_kanban_global_click' is
found, the focus fall back on the previous priorities.
task-3254564
closesodoo/odoo#119960
X-original-commit: 53a1061724faf9797e1301f93fdd708640313fc5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
*: web + adaptations in base, fleet, hr, hr_expense, hr_recruitment,
loyalty, lunch, mail, mass_mailing, note, project, stock, survey,
web_tour
**Foreword**
Since d19037e141 the rootnode class attribute for form/list views was
copied two times:
- on the o_view_controller div
- and on the root node of the view renderer.
Examples:
<form class="foo">...</form>
gives
<div class="o_view_controller o_form_view foo">
<div class="o_control_panel">...</div>
<div class="o_content">
<div class="foo o_form_editable ...">...</div>
</div>
</div>
and
<list class="foo">...</list>
gives
<div class="o_view_controller o_list_view foo">
<div class="o_control_panel">...</div>
<div class="o_content">
<div class="o_list_renderer foo ...">...</div>
</div>
</div>
**Issue**
This could lead to confusion and also unexpected styling issues.
See this PR #119815 to read a message JS Framework team has received.
See also another a fix that had to be made for x2m fields: 980244fa8
**Introduced Changes**
- in the form compiler, the root node attributes are no more copied to
the root div node of the compiled template the form renderer receives
- the root div node generated by the form compiler now has the
"o_form_renderer" class, which was removed during the recent form view
refactoring.
- the list renderer no more adds the root node class attribute to its
"o_list_renderer" div
- the X2ManyFieldDialog has been adapted too
- since View, X2ManyField & X2ManyFieldDialog both need to compute view
classnames derivated from the arch root node, an util has been
introduced to avoid duplicating code
- the whole codebase has been checked and adapted.
Related: odoo/enterprise#40418
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
https://github.com/odoo/odoo/pull/110188 introduced a change in the TagsList
component, making the className prop be used in the parent tag rather than the
image tag. This change makes sense as most times you want to add classes to the
root element in the component. However, in calendar, we used className to style
the image tag, to allow showing the calendar attendee status for an event. This
commit introduces the imageClass property that should be passed in the tags
prop. Therefore, tags list will now have both className and imageClass, making
it possible to style both tags.
task-3277079
closesodoo/odoo#118781
Signed-off-by: Arnaud Joset <arj@odoo.com>
*: mail, mass_mailing, sms, web_editor
This commit adds a new supportedOptions attribute that can be added to any
field widget metadata object. This documentation can be used from other places
(Studio for example) by getting the field from the registry and then read
this key. This attribute can contain an array, detailing the list of available
options for the field widget.
By using an array, it can be ordered easily without having an object with keys
unalphabetically. Ordering the options can make sense, especially when two
options are tied to each other, it is easier to group them one after the other.
(eg: 'start_date' first, then 'end_date')
Each option documented is an object and has the following attributes:
- help: contains more details on the current option and its use
- name: name used in the options object from the node
- label: a label with a more explicit name than the option name
- type: the type of value that must be used as a value (string, boolean, selection, field, domain)
- choices: for options with a 'selection': can be used to know available values
where multiple values can be chosen as the value. This must be
an array containing the options.
- availableTypes: for options with a 'field' selection: can be used to filter the
available fieldNames to choose as a value.
- default: the value that is used by default, when the option is not set
in the options
task-3259617
closesodoo/odoo#118713
Related: odoo/enterprise#39847
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Whenever an user updates a company or a currency, the webclient has to
reload, to properly apply these changes. It is done automatically,
immediately after the rpc has completed.
However, before this commit, it would do that always, even if the rpc
has failed (for example, if the user tried updating an invalid field),
so the user would briefly see an error window, then the browser is
immediately reloaded.
With this commit, we only reload the webclient when the rpc succeeded.
closesodoo/odoo#119730
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, users could not query properties
with the domain selector. Now, all the properties are
listed when selecting a properties field.
task id: 3283212
closesodoo/odoo#115270
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
On some mobile devices (eg Samsung Galaxy S22), the datepicker
immediately closes when trying to apply a custom date filter
Steps to reproduce:
1. Install Sales
2. Open Sales
3. Click on the search icon then on the filter icon
4. Click on 'Filters' and add a custom filter on field creation date
5. Click on one of the dates
6. The datepicker opens and then closes immediately
Solution:
Do not hide the datepicker when a scroll is made on mobile devices
Problem:
When opening the datepicker, the keyboard would show up, scrolling the
view which triggers the closing of the datepicker
opw-3166801
closesodoo/odoo#119682
X-original-commit: bd6ed025fae33ff3b0444d34142e1577a457b77f
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
This commit removes the module "web.dom_ready" and
adapts the modules that imported it.
This module was used to wait for the content to be
loaded to manipulate the dom after that.
The goal is to remove async modules and simplify the
module loader in the future.
task id: 3265979
closesodoo/odoo#119158
Related: odoo/enterprise#40051
Signed-off-by: Géry Debongnie <ged@odoo.com>
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.
closesodoo/odoo#119620
X-original-commit: f9604da60c6650ad46aafe08e9fad118654a149b
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
This commit adds two autoresize hooks for text inputs and textareas to
make it adapt their size (width for text inputs, height for textareas)
depending on their content.
The commit therefore solves the issue of several form view task titles
being restricted to 1 line while it can be annoying if the title is too
long. The autoresizeTextarea feature was moved from TextField to the
autoresizeTextarea hook and the autoresizeInput feature was moved from
the AutoresizeInput mail component to the autoresizeInput hook.
The TextField component has a new option for disabling linebreaks.
task-3138826
closesodoo/odoo#117355
Related: odoo/enterprise#39493
Signed-off-by: Géry Debongnie <ged@odoo.com>
*: l10n_fr_pos_cert,portal_rating,pos_adyen,pos_epson_printer,pos_loyalty,
pos_mercury,pos_restaurant,pos_restaurant_adyen,pos_restaurant_stripe,
pos_sale,pos_six,pos_stripe,web
This is part of the continuous effort of refactoring pos addons towards using
more modern modules and programming patterns (such as services). After this
commit, point_of_sale addons are now left with the use of the legacy
`web.concurrency` module because of the `MutexedDropPrevious`. It's okay to keep
it because it's relatively an independent module compared to other legacy web
module.
The following summarizes the changes in this commit.
- import `_t` from `@web/core/l10n/translation`.
- convert `PosDB` to js native class
- remove use of `format` in `TicketScreen`
- To determine the cached orders are up-to-date, we now deserialize the dates
coming from the server using web's `deserializeDateTime` function. Then,
instead of initiating `cacheDate` as native js Date, we use the luxon's
`DateTime` which is supported by the web date utility methods.
- There is no need for the `format` function from `web.utils` legacy module.
- convert `PaymentInterface` to native class
- remove use of `web.config` module
- remove use of `web.time` module
- use `serializeDateTime` from web.
- remove use of `web.rpc`
- remove use of `web.utils` module
- introduce simple check for email address input
- Replace use of `web.utils.Markup` with `@odoo/owl.markup`.
- 'web.utils'.{round_decimals,round_precision,float_is_zero} copied to
'@web/core/utils/numbers'.{roundDecimals,roundPrecision,floatIsZero}.
- These helper functions are not removed from the web addon because they
are also used from other addons that are not linked to pos.
- `floatIsZero` is now computed by directly comparing the result of
`roundDecimals` to zero. This works because rounding a decimal number
which will result to zero will exactly give zero.
- remove use of `web.field_utils`
- Replace `web.field_utils.parse.float` with
`@web/views/fields/parsers.parseFloat`.
- Replace `web.field_utils.format.float` with
`@web/views/fields/formatters.formatFloat`.
- Replace `web.field_utils.format.date` with
`@web/core/l10n/dates.formatDate`.
- Replace `web.field_utils.format.datetime` with
`@web/core/l10n/dates.formatDateTime`.
- convert `PrinterMixin` and dependents to native class
- `PrinterMixin` is converted to `BasePrinter`.
- `Printer` is converted to `HWPrinter` (extending `BasePrinter`).
- `EpsonPrinter` retained its name and is converted to extend `BasePrinter`.
- Moreover, we also removed the convoluted `PrintResultGenerator`, replaced by
simply creating object with the following signature:
```js
{ successful: boolean; message?: { title: string, body?: string } }
```
- remove use of `web.Session`
- replace use of `qweb.render`
- We use `renderToElement` as replacement to templates that produces valid
html.
- Note that `renderToElement` is introduced in `@web/core/utils/render` module
which is extracted from the original `renderToString` method.
- For the epson printer template, we kept the xml layout and manually add
required xml element to contruct the xml that will be sent to the epson in
making print requests.
- use `Mutex` from `@web/core/utils/concurrency`
- remove use of `Markup` when rendering receipt info (`ticket`) in order to
render new lines.
- Remove use of `jquery` in `htmlToImg`.
closesodoo/odoo#117231
Related: odoo/enterprise#39078
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Before this commit:
The AceField component used the ace library to provide the user a code
editing field
After this commit:
The AceField component is now using the CodeEditor component and the usage
of the ace editor lib is now abstracted behind the component.
closesodoo/odoo#117782
Related: odoo/enterprise#39365
Signed-off-by: Géry Debongnie <ged@odoo.com>
Before this commit:
When using the native ResizeObserver, we might get "ResizeObserver loop
limit exceeded" errors but these can ignore, see [ResizeObserver Errors](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver#observation_errors).
This error was wrongly handled and would cause another when running tests
involving the ResizeObserver.
After this commit:
The error is now properly detected and ignored when running tests.
Part-of: odoo/odoo#117782
This component was created as an easy way to add a code editing field
without needing a record (unlike the AceField component). It also
completely abstracts the use of the Ace Editor library.
The CodeEditor has been moved to web core as it was needed in other
places.
The name "CodeEditor" was purposely chosen to clearly state what the
component is used for and abstract the use of Ace.
Part-of: odoo/odoo#117782
With commit (1), the clear button is only displayed when a selected
value is found from the available choices. But since we used
shallowEqual to find the corresponding choice, we couldn't use objects
containing objects in its values, since a simple comparison was made
in the utility function. This was a wrong usage of the SelectMenu and
we don't want to support objects and arrays as values. The value
attribute should only be a string, and it's the parent responsability
to handle any object related to this string.
The test using an object and an array as values has been removed since
it had no purpose after the removal of this partial and wrong support.
With this fix, an assertion for the presence of the clear button has
been added instead for the import action.
(1): d760b81271closesodoo/odoo#119298
Related: odoo/enterprise#40177
Signed-off-by: Géry Debongnie <ged@odoo.com>
This commit fixes the property field tag components and sub-components by
ensuring that the ".bind" function of the component always receives a function.
As the "checkDefinitionWriteAccess" prop is optional, it could crash because
OWL would try to call ".bind" on an undefined function.
The new code will pass an empty function instead as a fallback.
(When it's not passed, it's never called, as it is in a display context and we
do not create tags, e.g: when showing the tags in a kanban view).
Task-3280847
closesodoo/odoo#119565
X-original-commit: 7d52600263bfd911156a2d94041fc522e2baff8a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Missing `nextTick` for this `tap` (compared to other similar calls).
closesodoo/odoo#119479
X-original-commit: 7ff8c563edf1b32ecf8222399637c294b5f58e9d
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
This commit makes sure that fields without widget
in kanban are properly formatted using the rawAttrs.
Steps to reproduce: create a float kanban field without
widget, set the digits to anything other than default and
see if the digits attrs are applied to the field.
opw-3263583
closesodoo/odoo#119161
X-original-commit: 1e635154654efcea59fe1f8bae679fb6bac41809
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When the text in the selection is long enough to
reach the selection caret, the caret is overlapping
the text making it unreadable.
Adding a gap between the end of the text and the caret
to prevent any text overlapping.
Task-3267526
Forward-port-of: https://github.com/odoo/odoo/pull/118059
X-original-commit: 717bba692d7167dbcd651299e84432dcecf13ab4
Part-of: odoo/odoo#119099
The footer 'selected count' button in the plan gantt view (project) wasn't aligned,
It's the case for every dialogbox where you can select many records,
simply removed a forced bottom-margin on the container
Task-3254488
closesodoo/odoo#119424
X-original-commit: 0125a3e233eeb4cf11ec7fc0ef429dabfaada05c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Have a multi edit list view, select several records and edit a
field represented by an input (e.g. a char field). After typing the
new value, press ENTER to validate. The confirmation dialog opens,
click on OK/Confirm to save. Before this commit, an error was
thrown afterwards, because we tried to retrieve the value from the
input, but the input doesn't exist anymore as the edited row has
already been switched back to readonly. This commit fixes the
issue.
closesodoo/odoo#119082
Related: odoo/enterprise#40012
Signed-off-by: Géry Debongnie <ged@odoo.com>
The primary goal of this commit is to simplify the RelationalModel
API, and in particular to remove its "fieldNodes" param, which was
only necessary for a list specific usecase, which is the opening of
the ListConfirmationDialog when multi editing. We also remove the
"blockUpdate" logic from the model s.t. it remains local to the
list controller. About this logic, we fix a minor issue as we no
longer open the "No valid record to save" dialog when the mousedown
event is trigerred on "Discard" (we instead wait for the mouseup,
like already done to open the multi save confirmation dialog).
Part of task 3179751
Part-of: odoo/odoo#119082
In the commit a2342f636c, we wanted to
use isFieldReadonly to find out if the groupField field was readonly or
not. Unfortunately, this function was not suitable for this use case.
IsFieldReadonly only works on a record and not on a list. It was a
mistake to move this function to the Datapoint.
In this commit, we will put IsFieldReadonly back in the Record and
not use it to know if the field of the groupField is readonly or not.
As in the past, we will consider that a field is readonly
if its modifiers.readonly is true (we cannot take into account the
expressions to be evaluated because the record is not accessible).
How to reproduce:
Go to a kanban view group on a field with an "attrs={readonly: [...]}
Before this commit:
The view will crash.
After this commit:
No errors occur.
closesodoo/odoo#119144
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit replaces a closing </xpath> with a </div>, and also prevents some
potential issues with class overrides for the div.
closesodoo/odoo#119196
Signed-off-by: Arnaud Joset <arj@odoo.com>
The new SampleServer class was introduced in c67b9f9907
without dedicated tests. We fix this oversight.
closesodoo/odoo#119188
X-original-commit: 693f7bd74066fa9854db4ecef751f13ec5c7e7a6
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, when quick creating a new record in a kanban view,
the "read more" button is briefly shown (flickering). This issue occurs
because, when creating a new record, we increment the number of records
in the group before adding the record to the list of displayed records.
This means that for a brief moment the number of records of the group is
bigger than the number of displayed records, therefore the "load more"
button is show.
Note that this flickering was introduced due to the following
refactoring : https://github.com/odoo/odoo/commit/067bcac53336b5f66f695b1c10b333d8c722225d
Now, we increment the number of records on the group after we added the
record to the displayed records' list.
closesodoo/odoo#119142
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Purpose
=======
Allow to use favorite in Knowledge embedded view.
For that purpose, we need to hook some function in the web module
(because favorites are stored in view arc and not using ir.filters
records).
Task-3251129
closesodoo/odoo#117188
Related: odoo/enterprise#39057
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/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>
`read_group` cannot order on the fields that are not
aggregates in the same transaction. We get a warning for it:
`<model>: read_group order by '<field_name> ASC' ignored, cannot sort on empty columns (not grouped/aggregated)`
Fix it.
Part-of: odoo/odoo#110737
This commit fixes how monetary fields are handled when doing aggregates in list view:
aggregates should not be computed when all values are not in the same currency and
the currency should be displayed with the aggregate when this is not the case.
closesodoo/odoo#116556
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit fixes a use case where a user would not be able to access the
property field values of a record because he did not have access to that
record's parent (from the property field definition configuration).
In a concrete example:
- In the Knowledge App
- Marc Demo has access to the "Article B".
- The parent article of "Article B" is "Article A".
- Marc Demo does not have access to "Article A".
- Article B has some property fields values configured.
- If Marc Demo tries to open "Article B" -> crash
This is caused by the framework having to read the property definition from the
parent record, which we don't have access to.
A "sudo" was added to allow that use case (which is supported).
In addition, this commit also adds further checks on the web client side to
gracefully handle a special use case where the end-user could not write on the
parent record because of record rules.
(It only checked *access rules*).
To avoid making an extra RPC every time we load the record (to check if we can
write on the parent), we only make that check when the user tries to modify
(add/edit/remove) a property and show a proper error message.
(This also applies when creating new property field tags).
Task-3062064
closesodoo/odoo#118929
X-original-commit: bc538f6944461a642bac0f757ec96d7f8cc14c9a
Related: odoo/enterprise#39946
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Replaced _.each() functions (average 235 occurences)
Description of the refactoring this PR addresses:
Current behavior before PR:
There are underscore.js function enumerated above used in odoo.
Desired behavior after PR is merged:
These functions has been replaced by native javascript
prototypes/methods/functions.
TaskId : 3246238
closesodoo/odoo#118565
Signed-off-by: Georis François (fge) <fge@odoo.com>