The function `sprintf` can use a dictionnary as second argument along with
named placeholders with the syntax `sprintf("%(argName)s", dict)`. But the
regex was wrong, making the first parenthesis optional and allowing
`sprintf("%argName)s", dict)` as a valid syntax.
closesodoo/odoo#132166
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Before this commit, the tip explaining how to open in a new tab was
long and innefficient.
This commit simply remove obvious "to open" text from the tip, which
makes the dialog less cluttered.
The corresponding translation file has been updated as well to update
the appropriated terms.
closesodoo/odoo#132602
X-original-commit: 871a988f91e7f4190999a89afa854f4ed83a4fa2
Signed-off-by: Florent Dardenne (dafl) <dafl@odoo.com>
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
* = account, calendar, im_livechat, mrp, project_todo, sms, snailmail,
test_mail, web, website_livechat
`contains` is more efficient than `afterNextRender` as it does not wait
for several extra animation frames, and it is functionally more
meaningful.
closesodoo/odoo#130451
Related: odoo/enterprise#44999
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Issue:
======
The time display for rtl language is the sale as ltr but in the
timepicker it's displayed as seconds-minutes-hours which is wrong.
Steps to reproduce the error:
=============================
1-Install calendar
2-Change the language to Arabic
3-Go to calendar and click on create new
4-Click on the datepicker for start for example and click on select time
Solution:
=========
I made the display of the datepicker independant of the direction of
language and alwyas display it in ltr direction.
opw-3423875
closesodoo/odoo#132589
X-original-commit: 3e21b50ef51b9f3ebf06b5cd16e3b11497b56896
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
Issue :
After the last fix https://github.com/odoo/odoo/pull/124663
there is still an issue of currency placements and alignement
of numbers in rtl language at the total and subtotals.
Steps to reproduce the isse :
1-create an invoice and confirm it.
2-install accounting
3-go to accounting/customer invoices and choose the created invoice
Origin of the problem :
The fields displayed didn't have the appropriate classes and the
style for number and monetary values for rtl language is missing from
the css folder.
Fix:
I applied the class on the `td` tag and `span` tag.
opw-3295573
closesodoo/odoo#132572
X-original-commit: e3eb140fb431aa1fc08e718d79f332c50e86c079
Signed-off-by: Bastien Fafchamps (bafa) <bafa@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
When there is an error in a report and user tries to
download that report a logger exception occurs.
Exception: Error while generating report
studio_customization.studio_report_docume_1c084f7d-9ac2-4dd4-9977
-03d87251392c
The error occurs from report_download controller -
https://github.com/odoo/odoo/blob/0d70e38ab4bab850ee4bddc7b21b4c6c10809294/addons/web/controllers/report.py#L136
The logger is updated to use the 'warning' level instead of the 'exception'
level when an error occurs while generating report.
sentry-4321014875
closesodoo/odoo#132528
X-original-commit: 1210e1c7bc97ea772df5d2230a3b8f42b13e9e10
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
In our continued effort to remove legacy code, this commit replaces
usage of the legacy mutex util with the new one, which is fully
compatible as a drop-in replacement. The legacy mutex has been removed.
Part of task-3439226
closesodoo/odoo#131748
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
The 'oe_inline' class does not allow the 'at' and the following elements to move to right when we have currency symbol of more than one character. Previously the value of max-width was set to 9rem which is now changed to inherit, so that it still have the space even if the space on the sides is consumed by other elements.
Steps to reproduce:
1. Set the currency of your company whose symbol is more than one character e.g AED
2. Start writing in expected revenue field.
Current Behaviour:
The input field will take over the 'at' string and overlap.
Expected Beahviour:
The strings and elements following the expected revenue input should move to right if the currency symbol's width increases.
OPW-3343377
closesodoo/odoo#131811
X-original-commit: 66946eb2311dd31b91d090b119ead610557d6b94
Signed-off-by: Bastien Fafchamps (bafa) <bafa@odoo.com>
Signed-off-by: Hamza Islam (hisl) <hisl@odoo.com>
This library provided the `nearest()` and `touching()` methods.
This commit replaces them by our own utility methods from
`@web/core/utils/ui`: `closest()` and `touching()`.
closesodoo/odoo#130818
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
The currency service is responsible for reloading currencies from the session_info, however it does not retrieve the correct key/value.
The issue can be reproduced in saas-16.4:
- Activate a currency
- Accounting Dashboard > Reconcile x items
- Client stack trace
(after hard refresh the correct currencies are loaded)
closesodoo/odoo#132375
Cause: the `reloadCurrencies` method is assigning the entire session_info response object to the session's currencies
X-original-commit: bbbf836f99b0271442e5e3a7ec03f108de69ec78
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
This commit fixes some isues with touch behaviors in the drag and
drop feature. Since commit (1), pointer events are used instead of
mouse events in the draggable hook. This makes the drag and drop
available with touch, but some issues appeared.
The following issues have been adressed by the commit:
- Scrolling in a kanban view has become difficult, since items are
dragged, and columns are moved. A simple scroll in the view to show
other items was nearly impossible without interacting with elements.
A small delay has now be introduced in the draggable_hook_builder by
default for touch interactions. The user has to do a long press (500ms)
to instanciate the drag sequence.
- on Windows laptops, the hasTouch helper would not return true, even
on PCs and tablets with a touchscreen, because 'ontouchstart' is not
present in the window object. It meant that any touch feature was not
working properly (e.g. moving icons from the home screen).
This commit adds a mediaQuery check right after the current check on
the window object, to also consider those laptops as touch devices.
Tests have been added to check the behavior of the touch drag, and the
presence of a bouncing animation when initiated. The corresponding drag
helper now has the possibility to set a custom pointerType.
task-3436591
closesodoo/odoo#132373
X-original-commit: 4c5cf0962f91d05085fea75e9c26ecdca9c0eb13
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
This traceback only occurs if you quickly assign and close the popover
during the rerender of the popover. We call an element inside the
popover already destroyed.
Steps to reproduce:
- Open a kanban view inside the project app
- Click on the "Quick Assign icon"
- Select a user A
- Press directly "escape" to close the dropdown a traceback occurs
=> bug
closesodoo/odoo#132337
X-original-commit: f75074d225a05571bea87589b81fbefb11b054f4
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
To Reproduce
============
- on project task add a property
- go back to list of tasks and try to export the modified task
an error is raised
Problem
=======
The property field is represented as dict (same for JSON fields)
Which is not expected in `write_cell`
Solution
========
handle `dict` type
opw-3431718
closesodoo/odoo#132303
X-original-commit: 1e9ed945c637e78b1003115dfd4042b3d87d8365
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
This commit simply corrects how the darkmode switch is displayed in the
user menu so that the switch won't overlap with its label.
task-3470052
closesodoo/odoo#132299
X-original-commit: 49176fe372dc09be65017013de8499b33d114045
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
Signed-off-by: Julien Carion (juca) <juca@odoo.com>
In this commit, all usages of env._t() are replaced by _t().
In templates files, env._t() didn't work because terms used
in attributes where not extracted into the translation files.
Only string are exported from .xml files to translation files.
So, to make it works, we set a variable that is then used
in attributes.
For example :
<t t-set="string_to_translate">String to translate</t>
<Dialog title="string_to_translate>...</Dialog>
task-3292454
closesodoo/odoo#131390
Related: odoo/enterprise#45631
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Before this commit, opening a record from an x2m in kanban mode could
cause a crash. For example, if the form view of the x2m contained an x2m.
Why:
The KanbanRecord listens to changes on activeFields through fieldNames
because activeFields is reactive and when the record is opened the missing
fields are added to the kanban view. This will cause a recalculation of
getFormattedRecord before the data has been loaded.
Solution:
ActiveFields and fields should not be reactive because we can only add
new activeFields or fields and we need to wait for the data to be present
before rendering them.
How to reproduce:
- Go to a form view with an x2m in kanban mode
- Click on a record (the form dialog must contain an x2m field)
Before this commit:
We have a crash
After this commit:
The form view dialog opens correctly
closesodoo/odoo#132225
Taskid: 3460126
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Goal:
* Simplified modifiers to only have one way to define modifiers;
* Remove states attributes on python field;
* Use python expression in view `required`, `readonly`, `invisible`;
* More accurate validation of xml views.
This commit change the syntax to python expression. The next commit
will update/convert all xml views.
Before this commit:
* the `required`, `readonly` and `invisible` attributes can only have
values of `True`, `False`, 1, 0 or a python expression to use the
context;
* the `attrs` attribute define a dict. The key of this dict was
`required`, `readonly` and `invisible` and the values are the domain or
a string representing a domain to be evaluate as python expression.
This python expressions was evaluate by the javascript with view fields
and other contextual values as: context, uid, parent, active_id,
active_ids, active_model, allowed_company_ids, current_company_id.
* the `states` attribute in the view was a comma separated list of the
state. This list was combined with the `invisible` attribute;
* the `invisible` attribute on python field is used as default value;
* the `states` attribute on python field was dictionnary with state as
key and list of tuple. This structure was combined with `readonly` view
attribute.
* After combining, the resulting domains of the different attributes
`required`, `readonly` and `invisible` are evaluated with the values of
the fields. The `invisible` attributes is splitted into two use:
`invisible` and `column_invisible`.
After this commit:
* The attributes `required`, `readonly`, `invisible` and
`column_invisible` define python expression. This python expressions
are evaluate by the javascript with view fields and other contextual
values as: context, uid, parent, active_id, active_ids, active_model,
allowed_company_ids, current_company_id.
The domains can contains contextual value and will be evaluate by the
javascript.
```xml
<field name="field_a" readonly="not context.get('show_a')" attrs="{'readonly': [('field_b', '!=', False), ('field_c', '=', parent.c)]}"/>
<field name="field_b" states="draft"/>
```
will be replaced by
```xml
<field name="field_a" readonly="not context.get('show_a') or field_b and field_c == parent.c"/>
<field name="field_b" invisible="state != 'draft'"/>
```
Some inherited views will be modified differently in order to maintain
the previous behavior:
```xml
<field name="field_a" readonly="not context.get('show_a')" attrs="{'invisible': [('field_b', '!=', False)]}">
```
```xml
<field name="field_a" position="attributes">
<attribute name="attrs">{'readonly': [('field_c', '=', False)], 'invisible': [('field_d', '!=', '3')]}<attribute>
</field>
```
will be replaced by
```xml
<field name="field_a" readonly="not context.get('show_a')" invisible="field_b">
```
```xml
<field name="field_a" position="attributes">
<attribute name="readonly" add="(not field_c)" separator=" or "/>
<attribute name="invisible">field_d != 3<attribute>
</field>
```
Validation:
A stricter control is made on the level of the attributes (modifiers)
and the fields necessary for these. The use of the previous attributes
'attr' and 'states' triggers an error (these no longer exist after the
application of the migration script)
task-2495504
Part-of: odoo/odoo#104741
Before this commit, when the same record is opened for the second time
in an x2m readonly, the record is in edition.
Why:
If the record has already been extended (when first opened), it is switch
in edit mode.
Solution:
The switch to "edit" mode should not be forced. The mode applied is passed to params.
How to reproduce:
- Go to a form view with an x2m readonly in list mode
- Open a record
- Close the dialo
- Open the same record
Before this commit
The record is in ed mode
After this commit
The record is in readonly mode
closesodoo/odoo#132246
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This will improve the following generic UX
- rename 'personal user stage' into 'personal stage' for private task
- added the 'personal stage' field to the right of the stage optional=hide
- earlier gantt view open with the user now it will open with groupby project
- removed groupby stage in pivot view
- rename 'undefined' into 'private' for graph view of private task
task-3251648
closesodoo/odoo#120094
Related: odoo/upgrade#4607
Related: odoo/enterprise#40515
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit adds some discuss-related options in the command
palette.
- hotkeys to add channel (C) & chat (D), and start a meeting (M);
- namespaces `@` or `#` show mentionned and recent conversations
in Discuss app when search is empty;
Items show optional badge with needaction counter.
Mentions/Recent categories are only visible when there are no
search term. Indeed, `@term` searches for users while `#channel`
searches for channels, so these categories are meant to quickly
jump to recent and important conversations. When typing some
search terms, the fuzzy search has precedence over mentions/recent
criteria.
task-3330218
closesodoo/odoo#128896
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Since the relational model (PR 114024) has been rewritten, in a grouped list
view, if we have a field with name (value, count, aggregates or length)
and it is aggregatable, then the aggregated value of the group is false.
Why:
When loading the group list data or will process the group. As a result,
values such as "value", "count", etc. are overwritten.
Solution:
We will no longer modify the group data, but only extrat what the Group
DataPoint needs.
How to reproduce:
- Go to a grouped list view with the "value" field aggregateable
Before this commit:
The value displayed on the group for the value field is wrong
After this commit:
The value displayed on the group for the value field is correct
closesodoo/odoo#132154
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
When editing a Many2One field with studio, and toggling "Disable
opening" with studio, it doesn't do anything because it's the wrong
option.
opw-3434895
closesodoo/odoo#132102
X-original-commit: 0ec5a45f1633ffaff91aba6808cf50ad1c58c60b
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Commit[1] introduced some changes in order to fix a layout issue in the
accounting dashboard but these changes were applied in a way that affects
a lot of modules and files that should not be modified.
In fact, by removing the padding inside the `kanban_dashboard.scss`
commit[1] is actually removing the padding in every place where
the boolean_favorite widget is used.
There is also a change applied in the Bootstrap library files, which
should remain untouched.
=== AFTER ===
We revert the changes applied by commit[1] and also fix the layout issue
in the accounting dashboard that it aimed to fix.
commit[1]: d4ba0c1
task-3453799
part of task-3326263
closesodoo/odoo#132134
X-original-commit: f78571cec0a5debf78c5dd1859c78b13d33df1ab
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit removes some code that would allow one to define multiple
templates with the same name, and would cause the the last template with
a given name to override the previous one. This doesn't happen in
practice, nor should it, and the code that is used to allow it
repeatedly queries the document for a selector that is difficult to
process (selecting for elements with a specific attribute value,
especially when many elements in the document have that attribute).
A simple profile, with the crm and project apps installed, brings the
time that it takes to load the owl templates from ~200ms to ~35ms
closesodoo/odoo#132044
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
The goal of this commit is to convert a bunch of legacy dialogs into owl dialogs.
closesodoo/odoo#131278
Task-id: 3453920
Related: odoo/enterprise#45484
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Steps to reproduce
==================
- Go to Payroll > Payslips > All Payslips
- Click on any line
- Click on the cog > Edit Payslip Lines
- Change an amount
- Press Tab
```
Cannot read properties of null (reading 'value')
at commitChanges (/web/static/src/views/fields/input_field_hook.js:163)
...
```
Cause of the issue
==================
A custom Field is used: PayslipLineField.
It is used to override the record.update to trigger an action.
https://github.com/odoo/enterprise/blob/f8c027685a49fca519fd6ac2f41dd5f30b243934/hr_payroll/static/src/js/payslip_line_one2many.js#L63-L80
This causes the view to be destroyed -> `inputRef.el` becomes undefined.
Solution
========
Use the field value before the update.
opw-3434835
closesodoo/odoo#131971
X-original-commit: 546978c70f5bee59b9985246977585ef59d761cd
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Change version of Chart.js from V2.9.3 to V4.3.0
You can find changelog on
https://www.chartjs.org/docs/latest/migration/v4-migration.html
Version 4.3.0 of chart.js no longer uses moment.js. This task is a
prerequisite to completely remove the use of moment.js (task 3391739)
Why add aspectRatio : 2 ? => Canvas aspect ratio (i.e. width / height,
a value of 1 representing a square canvas). Note that this option
is ignored if the height is explicitly defined either as attribute
or via the style. The default value varies by chart type; Radial charts
(doughnut, pie, polarArea, radar) default to 1 and others default to 2.
Why no more Chart.animationService.advance(); ?
There is no longer an equivalent in this version.
However, we have verified that the problem is no longer present in this
version.
Why use now getElementsAtEventForMode ?
It's clearly noted in the changelog. follow the link above.
task-3392075
Part-of: odoo/odoo#127259
This commit removes the legacy service classes:
- AbstractService
- AjaxService
- AbstractStorageService
- LocalStorageService,
- SessionStorageService
Only AjaxService was still used as a service so it is moves in the
"common_env" file.
task 3439226
closesodoo/odoo#131683
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
remove the condition where a many2one field can't be opened when the field is using the many2one_avatar (and its descendant) widget
closesodoo/odoo#131337
Task-id: 3454944
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Purpose
=======
When the DOM changes, we recompute the popover position. This is useful
for most popovers, but when we have a form inside the popover (like the
properties definition) it can be very annoying to move the form while
the user fills it.
Task-3380176
closesodoo/odoo#128983
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Currently there is the following problem in the document layout preview:
("Settings" app > "General Settings" > "Companies" section > "Configure Document Layout")
The address is displayed in the wrong place for the DIN5008 layout
(from the l10n_din5008 module).
This is fixed in this commit.
closesodoo/odoo#131935
X-original-commit: 663334157cc4867c63aedea8d8d893eb765cfe25
Related: odoo/enterprise#45754
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Sven Führ (svfu) <svfu@odoo.com>
This commit avoid a reset of the groupby filter applied in a kanban view
when a non-empty column of this view is deleted. This issue was
introduced by the conversion of the kanban view to
owl (https://github.com/odoo/odoo/pull/92475). It was fixed in master,
hence this commit only adds a test.
Steps (in saas 16.3)
=====
- Install module project with demo data
- Go to the kanban view of a given project (e.g. Office design)
- Group by Personal Stage
- Remove a non-empty column
Issue
=====
- After the reload of the view, the groupby is reset to the default
one (but the groupby filter is still the same in the control panel)
Cause
=====
The parameters of the view are not correctly passed/used to/by the
method load of RelationalModel.
Fix
===
Checking that the groupby field is not already set in load before
resetting it to its default value solves the problem.
task-3358595
closesodoo/odoo#131835
X-original-commit: af4be5ff868c106e854df3753ad9c147e718225d
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Steps to reproduce:
- Get Field Service app and the module for cutom worksheets.
- Create a new worksheet template that contains images.
- Create a new task with this template and go to the worksheet.
- Add any image.
Forcing the width to 100% breaks the view in safari since it's not going
to respect the proportions, removing this will have good behavior in
both safari and other browsers (chrome, firefox), also this
will have the same behavior it used to have in 15.0.
Be careful with adding this back in the future since when a user adds
inside his worksheet an image field, studio set the default size to
"small" value. (It's added an inline style with a widthset as "auto" and
a height set as "90px") but the image_field API was broken with the
w-100 added here[1]. It's seems not needed so we remove it to fix the
api.
[1]: https://github.com/odoo/odoo/commit/d1de396f2aa91a03732f0447d59a7306acae3129#diff-a9fcda7725e1ce88ca6deed7aff792476b26e264edc757b889e9dd3b94ea1dbfR33
opw-3415267
closesodoo/odoo#131808
X-original-commit: 740b560284e5c0987854f173437d7e4b3454caf5
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
Before this commit, the element returned by the function
renderToElement, it was still attached to the parent <div> added in the
render function.
Now, the element returned is detached.
Part of task~3443861
Part-of: odoo/odoo#130467
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.
Part of task~3443861
Part-of: odoo/odoo#130467
This commit removes the qweb.render method, instead it will use the owl
render engine (renderToString or renderToElement).
Part of task~3443861
Part-of: odoo/odoo#130467
This commit removes the qweb.add_template method, which was used to
add a template to qweb. Now we add the templates to the owl app.
Part of task~3443861
Part-of: odoo/odoo#130467
Before this commit, only templates with owl=1 were added to the owl app.
Now, all templates are added to the owl app, and none of the templates
is added to qweb.
Part of task~3443861
Part-of: odoo/odoo#130467
This commit ensures that files uploaded using the FileInput, upload
service or AttachDocumentWidget will not exceed the maximum file size of
the context in size before sending them to the server. It also moves
some utils from the formatters file to the numbers file so that one
can use them without requiring the view assets.
task-3390746
closesodoo/odoo#126914
Related: odoo/enterprise#45629
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
The limit was only enforced by the front-end, meaning that anybody could
forge a request with a huge file and get it processed by Odoo. According
to the documentation of werkzeug[^1], such limit should be enforced by
the server server instead of the wsgi application. It is the case for
Odoo Online but on-premise customers might not configure their servers.
The `web.max_file_upload_size` system paramter is now enforced upon
parsing the content of the request. It defaults at 128 MiB which is
enough for most documents and images. We do not want to host large
files (e.g. videos) in the Odoo filestore.
[^1]: https://werkzeug.palletsprojects.com/en/2.0.x/request_data/Fixes: #124646
Part-of: odoo/odoo#126914
Before this commit, having two RadioField fields with the same values
was going to confuse them. When you click on the second, the first is modified.
Why:
The id used to link the label to the field's input was mistakenly
removed during refactoring. So we're going to put it back, and each radio
field will have its own id.
closesodoo/odoo#131663
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Before this commit, editing a x2m record in a dialog then clicking on
the close button (X) does not discard the change.
How to reproduce:
- Go to a form view with an x2m in non-editable list mode
- Click on an x2m record to open it in a dialog
- Edit a field
- Click on the close button (X)
Before this commit:
The change is kept
After this commit:
The change is discarded
Part-of: odoo/odoo#131662