This commit adapts `base_import`'s background that was too dark
compared to other modules. This was caused by the use of a `bg-white`
class that is not very "dark-mode friendly" as it will display as a
pure black, which is not visually appealing and not wanted.
This commit also adapts the background color of the sidebar to make it
more consistent with other modules.
We also add a `bg-view` class to the table, so it stands out more in
light mode and stays the same in dark mode.
task-3814508
closesodoo/odoo#158822
X-original-commit: 57131926a3d2a20d2deb64a4a4f30b31cb6251e4
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
*: base_import, gamification, hr_skills, mass_mailing, portal,
portal_rating, survey, web, web_editor, website, website_sale,
website_slides
The goal of this commit is to improve the accessibility of the website
pages. This has been made by implementing and correcting ARIA
(Accessible Rich Internet Applications) roles and attributes. More
precisely:
- An `aria-label` attribute has been added on progressbar elements to
avoid a warning of type `ARIA progressbar elements do not have
accessible names`. It has also been added on iframes to avoid a warning
of type `<frame> or <iframe> elements do not have a title`. Furthermore,
`aria-label` has been incorporated on some anchors to avoid a warning of
type `Links do not have a discernible name`. Finally, it has been added
on elements that have the `dialog` role to avoid a warning of type
`Elements with role="dialog" or role="alertdialog" do not have
accessible names` and on elements that have the `listbox` role to avoid
a warning of type `ARIA input fields do not have accessible names`.
- To avoid a warning of type `Some ARIA parent roles must contain
specific child roles to perform their intended accessibility functions`,
`role="menuitem"` has been added on children of menu elements. As
explained in [the menuitem role documentation], "The `menuitem` role
indicates the element is an option in a set of choices contained by a
`menu` or `menubar`". To avoid this warning, `role="presentation"` has
also been added on elements located between `tablist` and `tab` and
between `menu` and `menuitem`. Indeed, as explained in
[the presentation role documentation]; "The `presentation` role removes
an element's implicit ARIA semantics from being exposed to the
accessibility tree". The goal is to inform the assistive technologies
that the default semantics of the element should be ignored. Finally, to
avoid this same warning, the `option` role has been added on elements to
identify selections a user can make in a `listbox`.
- The `aria-label` of some elements has been adapted in order to avoid a
warning of type `Elements with visible text labels do not have matching
accessible names`.
- The value of `aria-disabled` has been corrected to `true` (instead of
`disabled`) (see [the aria-disabled documentation]).
Still to improve the accessibility of the website pages, an alternative
text (`alt`) attribute has been provided for images.
[the menuitem role documentation]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/menuitem_role
[the presentation role documentation]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/presentation_role
[the aria-disabled documentation]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled#valuesclosesodoo/odoo#140453
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
For a first iteration, Russian translations were done using DeepL using
1 large .pot file of all the standard modules to translate (e.g. no
localizations, no test modules, etc). Unfortunately for some reason
doing a msgmerge with the existing ru.po files didn't seem to work, so
old "Translators" metadata at top of files were lost (maybe they will be
re-added during next Transifex sync?)
Part-of: odoo/odoo#152285
Current behaviour:
Wrong format used when importing dates
Steps to reproduce:
1. Change your language to German
2. Go to Sales > Orders
3. Export to XLSX
4. Change to dates to german format (ie: 10.09.2023)
5. Favorites > import records > Upload file
6. Click on Test
7. "does not match format '%Y-%m-%d'"
Cause of the issue:
Only default formats were taken into account
because options are empty.
opw-3540715
closesodoo/odoo#146744
X-original-commit: bdc006a81f83efddd693a8d4f4ffaec92da36f4a
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
An error will be generated when a user tries to import or upload a file into the
invoice module and the file is attached to an image via a URL form but the
image is invalid or cannot be found.
step to reproduce-
- install the `Accounting`.
- open Accounting > Vendors Menu > Products.
- import file (image url must be invalid or not found )
- the error will be generated.
At the time of solving the conflicts of FW mistakenly changed the
"ImportValidationError" to "ValueError". Due to these changes,
the error is shown in the log.
FW - https://github.com/odoo/odoo/pull/137596
sentry-4538772256
closesodoo/odoo#144011
X-original-commit: 581c0c69f368f08bcf9803942027b172b8bc2694
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
When we're exiting the import view, we need to have ids of the imported records
to confirm that the import was successful and to filter on import records if
needed.
This commit adds an optional resIds parameter.
task-3549609
closesodoo/odoo#140969
X-original-commit: bb968c5e197e37c0391209420655a777821aa3f1
Related: odoo/enterprise#50141
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
This commit adds the "alt+u" shortcut to open the cog menu in order
to match with the behavior of the actions menu.
task-3560446
closesodoo/odoo#140798
X-original-commit: fbf245cb81453e1fedbfd4649a8284546da44ffb
Related: odoo/enterprise#50074
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
Steps to reproduce:
1. Install stock
2. Go to Inventory > Products
3. Cog wheel > Import records
4. Make a xlsx document where:
5. the first sheet has at least 2400 records (with header)
6. the second sheet only one record (with header)
7. Upload the document
8. Select the second sheet
9. Set batch limit at 2000
10. Click on import
11. 2 records successfully imported
Cause of the issue:
When initially uploaded, this.state.fileLength
is set to the length of the first sheet
And isn't refreshed when changing sheet
opw-3507544
closesodoo/odoo#139470
X-original-commit: 27f0a0253bc9b44854e5d6436d6e550429cdb93c
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
When a user tries to import the CSV file with an empty text delimiter
or more than one character in text delimiter at that time the traceback
will be generated.
Steps to reproduce:
- Install Accounting module.
- Click on import in the bank statement.
- Select any CSV file for the bank statement line or can download and import
this file - https://drive.google.com/file/d/1lnScw4RN6T01pOkyNON8vvb3FQOPiy1O/view?usp=drive_link
- Enter empty text delimiter or more than one character in text delimiter.
- Click on the test or Import button.
- Error will occur.
Error: ValueError: Unsupported file format "text/csv", import only supports
CSV, ODS, XLS and XLSX
The issue is occurring because text delimiter (options['quoting']) is used
as quotechar while reading csv file and quotechar is always a single
character string. Check here -
https://github.com/odoo/odoo/blob/0fde590bee71618f78e5f954349530bd007c62cf/addons/base_import/models/base_import.py#L494-L497
To solve this issue the length of text delimiter has been checked and if it
is not equal to one then a warning is given to the user.
sentry-4390461991
closesodoo/odoo#138638
X-original-commit: 1f4aa620779ebe6a0cb7f7ca1910080a258d6fac
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
This issue occurs when a customer imports or uploads a file, and that file
contains an image that is attached to the URL as text or HTML. then,
The error would be generated.
Step to Produce:-
- import CSV file (Ex.'product.product' model)
> that CSV file must have one URL Image(In that URL has content of text or
Html form)
- Click On the 'Test' Button.
Applying these changes will resolve this issue.
sentry:-4046190590
closesodoo/odoo#137611
X-original-commit: acbb5af7ee96cdc579850427bc2bca6d7bf184e4
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Steps to reproduce:
1. Install hr_attendance
2. Go to attendances
3. Select any line
4. Change the check-out date to next day
5. Change the check-out time to 00:00:00
6. Export that line, file format xlsx
7. Favorites > import records
8. Upload the exported file > Test
9. Column check_out contains incorrect values.
Error in line 2: unconverted data remains: 2023-06-11
Cause of the issue:
options.get('date_format') is empty
opw-3374883
closesodoo/odoo#136485
X-original-commit: 973af5854de4a9fa3a9f5bd3bca8c7b342ff71e9
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
In this viewtiverse, the heroes remove the context dependencies for
`get_views`, from the views and python fields (such as domain). To reduce
inconsistencies and the number of rpc.
Current issues:
* There may be inconsistencies in views at the JavaScript level. Some
overrides modify the behavior of get_views or domains on fields via
context keys, therefore by changing the action, the rendering may be
different. However, these views are cached. However, the cache key
(Javascript) does not reflect the entire context, and requires additional
post-processing from the server.
* Multiple rpc for the same rendering. get_views being dependent on the
context, as soon as it changes, a new rpc is performed. In most cases,
when JavaScript needs the same view, there is no change depending on the
context, the rpc is useless.
* Inconsistency when rendering subviews, some views could be different
depending on the context, this context can be modified in the view itself
via the context attributes. However, the JavaScript client does not redo
an rpc for each change of these sub-contexts. Therefore the result may be
inconsistent.
Solution:
Limit as much as possible the number of context keys provided when calling
get_views, and use the context provided as a cache key. The authorized
keys are 'lang' and '*_view_ref'. For the cache key, options are added in
the get_views method.
Instead of using the context, it is inserted into python expressions.
This will be evaluated by JavaScript and thus avoids inconsistencies.
task-3414108
task-3414068
closesodoo/odoo#135145
Related: odoo/enterprise#47584
Signed-off-by: Raphael Collet <rco@odoo.com>
Before this commit, when selecting the field to import, the name, external
id and database id could not be selected separatly while they should.
This commit fixes that by comparing the full field path instead of the id
of the fields.
closesodoo/odoo#135482
X-original-commit: 587ee0797bd0075dc7d3a0393ec95360c8ab0770
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
When a user tries to import the CSV file with a different separator at that
time, the values in mapper and rows_to_import are not correctly mapped. So
the traceback will be generated.
Steps to reproduce:
1. Click on import in the bank statement.
2. Select any CSV file for the bank statement line or can download and import
this file https://drive.google.com/file/d/1lnScw4RN6T01pOkyNON8vvb3FQOPiy1O/view?usp=drive_link
3. Select any separator other than a comma.
4. Click on the test or Import button.
5. Error will occur.
Error: IndexError: list index out of range.
To solve this issue, a row's length is checked with the
number of fields.
sentry-4021250095
closesodoo/odoo#134596
X-original-commit: 0eb30132c14420d42f88a5f54a81ba1dc51a867c
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
This partially reverts commit da50ce31ae825ef9f4b527553a2e2caec970d290.
Whilst the behavioral changes done in the task are correct, the wording
is not optimal and was better understood by users before this change.
Task-3483936
closesodoo/odoo#133511
Related: odoo/enterprise#46503
Signed-off-by: Florent Dardenne (dafl) <dafl@odoo.com>
Issue :
When you try to import a big file it will display a blank error.
Steps to reproduce the error :
1-install inventory and e-commerce
2-go to products and import records
3-upload the file attached the ticket
Reason :
Before, there was a type included in the `reason` but now
it seems that the error has no type neither a message.
Fix:
I tried to just output a general error.
opw-3410954
closesodoo/odoo#133950
X-original-commit: 95cc5c84c3b4529cd269cf278fd4ab289f28685f
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@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>
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
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
Improve gettext to directly handle value injection within translations,
removing the need for sprintf.
closesodoo/odoo#123932
Related: odoo/enterprise#45370
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
In the commit [1], the patch has been refactored to support the
native keyword `super`. The current commit just adapts the codebase
to that change.
task 3410198
[1]: 19ea1ac08043e22a811630968e44715cc3bfc495
Part-of: odoo/odoo#125716
One of the main issue with ormcache is that the invalidation clears
everything, meaning that some value, slow to compute but with a long
lifetime, can be removed from the cache because an easy to invalidate
value is cleared, like after writting or creating a product has an
example.
Most example in the code will try to invalidate the cache of the models
doing something like `env['ir.qweb'].clear_caches()` but it is
finally equivalent to `env.registry.clear_cache()`, and cross worker.
The idea is to have multiple cache, maybe with specific sizes for a
specific purpose.
Having one per model is maybe a bad idea because it will be difficult
to size the LRU correcly, and it is too dynamic. Checking invalidation
may be expensive.
The proposed solution is closed allow a limited number of named caches,
using onse sequence per cache. This is actually close to the
cache_longterm.
We want to discourage using a specific cache for one use case in
the buisness code. Adding a cache shouldn't be something easy, doable
in stable.
Note that we could also change the invalisation mecanism using an
insert only table. We an check the sequence of this table, but also
fetch all invalidation messages.
Another possible improvement, especially if we have more than x cache is
to have a global sequence, checking signaling would mean to check the
main sequence, and only the other ones if the main one changed.
Note that this poc is inspired from the long term cache but not all
use case where applie yet.
Part-of: odoo/odoo#119813
This commit changes the behavior of the "Search More..." option in
Many2XAutocomplete and analytic distribution by making it available
as long as there's at least one record in the search results and by
renaming it to "View all".
task-3258625
closesodoo/odoo#126041
Related: odoo/enterprise#43660
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
*: account, base_import, board, website
This PR enhances the "cog menu" by fixing several UX flaws.
Notable improvements include:
- Reordering entries in a more logical manner, enhancing user intuitiveness.
- Assigning icons to common actions for quick comprehension.
- Grouping both print actions and module-specific actions for better organization.
Enterprise:
- https://github.com/odoo/enterprise/pull/41851
task-3337951
task-3355224 (milk post-merge fixes)
part of task-3326263
closesodoo/odoo#124413
X-original-commit: 596772885a87016d29f002cd4e41b5a973965e40
Related: odoo/enterprise#42212
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
Co-authored-by: Pierre Paridans <app@odoo.com>
Co-authored-by: stefanorigano (SRI) <sri@odoo.com>
=== ISSUE ===
If you go to PLM > click on a primary button > click on the cog >
import records, the buttons have a `.m-1` which is added on top
of a `.gap-1`.This result in a double margin, which is not consistent
with other CP's behavior and affects the whole CP layout.
=== AFTER ===
We remove these unnecessary `.m-1`, making sure that no matter how many
buttons are shown they have a correct spacing.
task-3355375
part of task-3326263
closesodoo/odoo#124337
X-original-commit: 40666bfe89ff5bc9013fbb20928c18001b66c6ad
Signed-off-by: Pierre Paridans (app) <app@odoo.com>