Commit Graph
6751 Commits
Author SHA1 Message Date
Pierre Paridans eef262abf4 [FIX] *: adapt QUnit tests and tours
[FIX] *: selectors in tours

[FIX][TMP] account: CogMenu selector in tours

[FIX][TMP] web*: Breadcrumb targetting in tours

Adds a `o_breadcrumb` class to target the whole breadcrumb, no matter
how much elements it contains (collapsed parts, visible path, single
name...).

add classname on last breadcrumb item

[FIX][TMP] project: View buttons selector in tours (moved away from CP)

[FIX][TMP] project: Kanban selectors in tours (quick create)

[FIX][TMP] *: SearchBar selectors in tours (toggle menu)

[FIX][TMP] *: ButtonBox selector in tours

[WIP][IMP] web: add toggleSearchBarMenu in search helpers

adapt and unskip 3 list tests

adapt and unskip calendar tests

unskip web_tour test that actually pass

post rebase fix

allow to lose cell focus after multi edition (given to searchbar) - bug reported, to check later

post rebase fixes

fix

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
Elisabeth Dickinson 80098df3dd [FIX] *: fix ribbons position and size
This commit fixes the ribbons used in `kanban` and `form` views.

The SCSS uses the square root of the parent `div.ribbon` to calculate its
diagonal width and applies that width to the child `span`.

After changing the ribbon's transform-origin, we calculate the ribbon's
position based on CSS variables of the view's top padding,the height of
the ribbon and the shadow's size (to avoid it being cropped by
overflow-hidden).

By changing the values of a few of these variables in the kanban view,
we were able to remove all the specific SCSS related to ribbons in the
modules.

Other changes were applied inside some of the modules to make this
work:

- `event`: padding corrections on the kanban's cards;
- `hr_holidays: replaced `margin:0` in the SCSS with negative margin
utility classes on the element to achieve the same visual result;
- `discuss`: moved the ribbon to the parent element;
- this was also done to `discuss`, `survey` and `helpdesk`;
- `crm_team_view` in `sales_team`: the ribbon's height made it overflow
from the kanban's card. We fixed this by changing the value of one of
the CSS variables in the view's SCSS file;
- the same thing was done in `survey` and `appointment`;
- `website_event_exhibitor` had some SCSS that wasn't being used because
it uses `.o_ribbon` instead of `.ribbon`

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:21 +02:00
Elisabeth Dickinson b2ef35a431 [IMP] *: replace .bg-color by .text-bg-color on ribbons
Also remove unnecessary CSS on ribbons.

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +02:00
Xavier Luyckx (xlu) c1080c8638 [IMP] *: onboarding, milk adaptations
*: onboarding, account, account_payment, sale.

Currently used in the appointment module (See c1cf8bfb).

Related Task-3297572

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +02:00
Brieuc-brd 18cb11891e [IMP] *: use svg icons instead of png
Prior to this commit, some icons used the png version.
After this commit, the svg version is used instead.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:15 +02:00
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +02:00
stefanorigano (SRI) 79f57643ce [REF] web, mail, hr, website, auth_totp, test_apikeys: top-menu design
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:13 +02:00
Julien Alardot (jual) a171597d19 [IMP] base: Add a dummy VAT number to demo partners
This just sets a dummy VAT number for all the demo partners

We need to access the demo partners vat number in
l10n_es_edi_facturae, and overriding data in the
other module could lead to different behaviours in
the future

Task: task-2793440
Part-of: odoo/odoo#108350
2023-05-12 19:54:22 +02:00
Benoit Socias 4978d2d107 [IMP] *: allow empty frontend m2o and deselection in the editor
*: base, web_editor

The Many2oneUserValueWidget does not allow the user to reset it
to blank if it already contains a selection. This commit makes it
possible to select an empty value by specifying a `null_text` option.

task-2406626

Part-of: odoo/odoo#67913
2023-05-12 19:54:08 +02:00
Christophe Simonis 0a159622c2 [FIX] core: ensure odoo.upgrade __path__ contains real directories
mimic what is done for `odoo.addons` __path__.

closes odoo/odoo#121211

X-original-commit: 2a981e6a561f572742202d9c964d3b1f3aecacf9
Signed-off-by: Christophe Simonis <chs@odoo.com>
2023-05-11 19:21:14 +02:00
Jay Savaliya be32787832 [FIX] base: partner creation from name
In  https://github.com/odoo/odoo/commit/6371565e6933d6ede88fa85992f4acbc2cb5327b we expect required fields to throw  ValidationError when not set,
we thus correct res_partner to raise that error when the email is implicitly
required, so after this commit if we can try to create a new partner from the
name directly then It will give a validation error and wizard will open for the
creation of a new partner.

Task-3297388

closes odoo/odoo#121127

X-original-commit: 98aca8f76f7509b143263100384a2f2ed644124b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-11 18:25:36 +02:00
qsm-odoo 1b428bd0b0 [FIX] web, base: review lazy loaded <script> definitions
The assets bundle system allows to generate `<script>` elements whose
resource is meant to be lazy loaded. In that case, a "data-src" is used
instead of "src" directly as attribute. This is valid HTML code: "src"
is not required. However... this lazy loading system also automatically
added `defer="defer"` which makes the "src" attribute required, thus
failing W3C validation.

Now, we only add "data-src" and the `defer="defer"` part is added on the
client-side, once the "data-src" is switched to "src". Note that this
"defer" attribute may not be needed in this case at all, but it cannot
hurt.

Part-of: odoo/odoo#120311
2023-05-11 18:25:08 +02:00
Nicolas Lempereur ec0381ddd3 [FIX] base: invisible groups default on user creation
Since 16.0's 0501bbd62e fields with groups are now removed from the view
instead of being set as invisible.

Scenario:

- template user has group "Access to export feature"
- create a new user while being in debug=0 mode
- save

=> the users don't have the group "Access to export feature" set,
because the corresponding field is not in the view. If the same scenario
was done in debug=1 mode, we would get the group set.

Solution: duplicate the field that are inside base.group_no_one section
and have them be invisible if someone is not in debug mode.

note: before the fix, added assert fails because there is missing groups
in the newly created user.

closes odoo/odoo#121097

Note: issue observed when working on another ticket
X-original-commit: 9deb1e6aa902a09c4fd6a91ecbd34a89b9c98f98
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2023-05-11 10:41:03 +02:00
Julien Mougenot 805197daf9 [IMP] web: Optional start date in daterange fields
Before this commit, the date/datetime/daterange fields only allowed for
an optional end date field. This meant that the primary date was always
the start date.

This commit allows the field to do the opposite: with the primary date
being the end date, and having a `start_date_field` option for an
optional start date.

closes odoo/odoo#120695

Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-05-11 09:36:24 +02:00
Aurélien Warnon 728ceccca1 [IMP] base: introduce "_is_portal" on res.users
This commit introduces a "_is_portal" method complementary to the existing
"_is_internal" and "_is_public".

The goal is to ease usage through the code base and be able to easily
distinguish our 3 main use cases: public, portal and internal users.

Task-3056280

closes odoo/odoo#120827

Related: odoo/enterprise#38575
Related: odoo/upgrade#4575
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-10 19:16:57 +02:00
Xavier-Do a6f8de2cf2 [IMP] base: speedup routing map
When generating the routing map, `Rule.add` will call
`Rule._compile_builder` twice, representing almost one third of the
routing map generation time. `_compile_builder` is actually stored
in `Rule._build` and `Rule._build_unknown` for latter use, in the
`Rule.build` method.

The `Rule.build` method is used to transform a rule, lets say
`/forum/<model("forum.forum"):forum>` in `/forum/basics-of-gardening-2`

Even if a deeper investigation could be interresting, it looks like it
is only used for `is_frontend_multilang` routes and `_enumerate_pages`,
used in the `sitemap` and `search_pages`.

The proposed solution si to make this part lazy, in order to call
_compile_builder on demand, once per rule. This will speedup the initial
routing map generation and postpone the heavy work when we need it,
only for the part we need most of the time.

On a database with all modules installed, generation of the routing map:
Before: ~600 ms
After: ~200 ms

An alternative implementation was also overriding the Rule.build method
instead of having a callable LazyCompiledBuilder, this implementation
was choosen since it is less dependant off the werkzeug implementation.

closes odoo/odoo#120542

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-05-10 15:19:47 +02:00
Xavier-Do 7fda050abd [IMP] core: imcrease re.MAXCACHE
`re` is using an internal cache for regexes with a default size of 512
This is correct for small apps running on small infrastructure
but as a simple example, the routing map will compile ~1100 regex in a
row. This means that generating two routing map in a row don't benefit
from this cache at all. It looks reasonnable to increase this limit
globally for odoo.

This is visible when generating two routing map in a row.

After this change:

Generating routing map for key None
Routing map web generated in 0.194s
Generating routing map for key 1
Routing map website1 generated in 0.196s

After this change:

Generating routing map for key None
Routing map web generated in 0.200s
Generating routing map for key 1
Routing map website1 generated in 0.062s

Part-of: odoo/odoo#120542
2023-05-10 15:19:47 +02:00
pedrambiria 70648b064d [FIX] base: add commercial_company_name to the depends
Before this commit: if you add a custom one2many field to the
'res.partner', like x_related_commercial_partner_ids, that is related to the
`commercial_partner_id` in the`res.partner` model, it won't update the
display name of a contact in case of changing its parent_id name.

Here are the steps to reproduce the problem:
 1. Create a new custom field with these values:
   a. Field Type = one2many
   b. Model = Contact
   c. Related Model = res.partner
   d. Relation Field = commercial_partner_id
 2. Create a new Contact that is the "Company" (e.g. "My Company")
 3. Create a new Contact that is the "Individual" (e.g. "My Name"), and
    put the "My Company" as its parent_id.
 4. Now the display_name is "My Company, My Name" which is correct
 5. Change the company name to "My new Company"
  -> display_name won't change, and is "My Company, My Name"

The solution is to add the 'commercial_company_name' to the
`display_name` depends.

opw-3202894

closes odoo/odoo#120908

X-original-commit: f242cad9a27fb0e58e1b9c726573b316534f6be8
Signed-off-by: Rémy Voet <ryv@odoo.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-05-10 05:34:44 +02:00
william-andre 9f13817425 [IMP] base: allow to add country flags on module kanban
The icons made for localization require tedious manual work where it
could be done easily with some css.

task-3166075

Part-of: odoo/odoo#108617
2023-05-10 04:14:49 +02:00
Renilkumar Kajavadra a1c5e9a8b1 [FIX] base: change logger type to 'warning' on format mismatch
If applied, this commit will handle the KeyError: res_id when the user tries to
import the translation of .csv file in settings -> translations, and if .csv
file doesn't have the res_id column.

I handled the traceback by changing the logger level to warning.

sentry - 4049419481

closes odoo/odoo#120904

X-original-commit: f5b69559a04cad9a693b991497936cf11ca36aeb
Signed-off-by: Rémy Voet <ryv@odoo.com>
Signed-off-by: Renilkumar Kajavadra (reka) <reka@odoo.com>
2023-05-10 02:00:51 +02:00
Xavier-Do ab1e4f670a [REF] web_editor: change custom url
Before this commit an ir_assets generated automaticaly by the web editor
will generate an url ending with ...custom.addon.bundle_name.ext

After this commit the url will start with /_custom/addon.bundle_name/...

This will make it easier to spot at immediately if it is a custom asset
and thus it is useless to apply the glob. Actually, it will fail on the
/_custom when trying to glob, making it faster.

This is mainly useful to clarify and debug but in a case with mainly
customised ir_asset for one bundle, it may have an impact on speed.

An upgrade script was created for this change.

closes odoo/odoo#120699

Related: odoo/upgrade#4636
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-05-09 18:27:01 +02:00
Rémy Voet (ryv) d2c2f5bfc2 [FIX] core: invalid field should raise an Exception in domain
Since https://github.com/odoo/odoo/commit/5a998694a6f353da05d7f69e4c59b9e7dd139e27,
we don't crash anymore at https://github.com/odoo/odoo/commit/5a998694a6f353da05d7f69e4c59b9e7dd139e27#diff-fa4d9268d6e65e19aebec81c46038f0e496b91142588ed4d1c1bce7ff2338f2cL759
(at `field.auto_join`) if `len(path) > 1`, `field` is translated the
`left` is not only a field name (example: `"name.<something else>"`).
Because we trust `left` at this [point](https://github.com/odoo/odoo/blob/1bbdd77f0ee6bd632f5ade88b8b71c5576fa9053/odoo/osv/expression.py#L1339),
(we shouldn't, coming from https://github.com/odoo/odoo/pull/101115)
then SQL expression generated for translated field is unsafe
(SQL injection).

In case of translated field, check that `left` side is only a valid
field name. (if it is not, it will crash later in `__leaf_to_sql`).
In addition, use `field.name` instead of `left` when it is possible to
be more robust.

closes odoo/odoo#120565

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2023-05-09 18:26:52 +02:00
Adrien Widart (awt) 28075c915b [FIX] core: translate SQL constraints
To reproduce the issue:
1. Install `mrp`
2. Send a RPC to create a new BoM:
   - `{"product_tmpl_id": 1, "product_qty": -1}`

Error: It will generate a traceback

Because of the negative product qty, the RPC triggers a SQL constraint
that we try to return. However, the context does not have any `lang`,
hence the traceback

sentry-4088426130

closes odoo/odoo#120614

X-original-commit: badc554b9dd7a299aac8ebca24bec6b90bef779a
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-05-09 11:57:14 +02:00
Raphael Collet 58bd33ccde [IMP] core: make onchange2() work with properties fields
The issue with properties fields is that the value in the record
snapshot is not correct.  This is caused by convert_to_record()
combining the values with the definition, and in the case of onchange(),
the values don't match the definition, which causes the method to return
the empty list [].

We fix the root cause by changing convert_to_record() to return the dict
itself.  The combination of the values with the definition is now only
done in convert_to_read().  Method convert_to_onchange() has only one
hack to retrieve the current definition record from the record snapshot,
as because of cache invalidation, its value is no longer available.

closes odoo/odoo#120457

Signed-off-by: Raphael Collet <rco@odoo.com>
2023-05-05 18:08:10 +02:00
std-odoo dc95819257 [IMP] base: do not write in database when we have invalid properties names
Purpose
=======
When we create a new record, we can change the definition on the definition
record. If the parent had no definition, in `_add_default_values`,
we just return the value. But in some weird cases, if we have
invalid properties name in the value, the will be written in database.

Now, in that particular case, we propagate the value only
if we try to change the definition.

Part-of: odoo/odoo#120457
2023-05-05 18:08:09 +02:00
Raphael Collet 7a5f655879 [FIX] test_new_api: introduce proper test mixin
Part-of: odoo/odoo#120457
2023-05-05 18:08:09 +02:00
Xavier Morel 9f2cfb2cdf [IMP] test_module_operations: make uninstall step more graceful
- process modules to uninstall individually in order to better handle
  their state at that point
- uninstall (and reinstall) modules in provided order, rather than
  whatever postgres feels like (or a sort which might not match what
  we want), mostly useful when uninstalling modules in bulk
- warn if a module is either missing or already uninstalled, rather
  than silently do nothing

closes odoo/odoo#120261

X-original-commit: 034b317a908d1aea6dc6d992c489b30ffff8f1ce
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-05-05 18:08:00 +02:00
Xavier Morel 44f7ccc100 [IMP] test_module_operations: logging configuration
- switch to `dictConfig` for easier bulk-manipulation of loggers
- set `unlink` and `ir_model` loggers to warning, to limit the
  humongous spam that is a normal uninstall session

X-original-commit: bee7898a5af68128b599d30ac7d4c0193e765afd
Part-of: odoo/odoo#120261
2023-05-05 18:07:59 +02:00
Xavier Morel d5a3e3e794 [IMP] module_operation_tester: use subcommands
Add subcommands to make running the script clearer (as exclusive
switches is a bit weird nowadays).

Keep the old `--uninstall` and `--standalone` switches, but make them
mutually exclusive (and optional) to retain current behaviour.

X-original-commit: 933841eda86292f180170b32da621f55fe6f0b84
Part-of: odoo/odoo#120261
2023-05-05 18:07:59 +02:00
Xavier Morel f2de38b84a [IMP] test_module_operations: make debugging easier
- ensure `test_module_operations` exits with a non-zero status on
  failure, as the current makes it a lot less convenient to notice
  uninstall / reinstall errors (especially with lots of warnings
  crowding the logs)
- allow uninstalling without reinstalling, so it's easier to inspect
  db state after uninstall

X-original-commit: 712977faf9bf98d9087368ab4fe95f089a072601
Part-of: odoo/odoo#120261
2023-05-05 18:07:59 +02:00
Julien Mougenot 6cdbce8490 [IMP] form: Support daterange field dependencies
This commit allows the server-side form arch parser used in tests to
also include the "end_date_field" defined in the `options` attribute of
daterange widgets in the dictionnary of fields found in the arch.

The daterange widget is currently the only case where the client adds
another editable field dynamically in the list of known fields. This is
not ideal since the server does not know that when computing the initial
arch sent to the client. The workaround is to also include the
"end_date_field" in the arch with `invisible="1"`, and to add a special
case for the server-side form arch parser used in tests.

Ideally we would want a proper way to define field dependencies in the
arch, but since this widget here is the only use case for that feature
it is better for now to handle it in this simple, more naive way.

Part of task 3121497

closes odoo/odoo#112171

Related: odoo/enterprise#38569
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-05-05 13:52:22 +02:00
Chong Wang (cwg) 55c9ca692f [FIX] base: translate ir model fields
before this commit:
after #109858
The method `update_field_translations` won't directly call the `write`
As a result, when changing the translation of fields from translation dialog,
the orm cache won't be cleared, and translations won't be updated in views
even after refresh the page

after this commit:
when users translate fields and refresh the page, the new translation can be
updated in new views

opw-3267024

closes odoo/odoo#120602

X-original-commit: 8d8dbab203fe7c153522dcb2a420d97dc4adaadb
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Wang Chong (cwg) <cwg@odoo.com>
2023-05-05 12:44:05 +02:00
Xavier-Do 10cccd1cb7 [IMP] base: add test for routing_map perfs
This test will help making stats on routing_map generation performances

This will help to mesure the time for the main `None` routing map as
well as for website1, the idea being that it would be possible to
mutualize a part of this computation between routing maps.

closes odoo/odoo#120591

X-original-commit: 6646fa7e2ef64e5f060bf38b0d85bf1188d79e4f
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-05-05 00:39:47 +02:00
Patrick Hoste cde4a9c647 [IMP] base: improve user password wizard
This commit fix the users login disappearance when
hitting 'Change Password' button without setting a
password by adding force_save parameter. It also
removes the required parameter from the new_passwd
field so we don't get a vague missing field error
when one omits to enter a new password. Instead of
an error, we just leave the old password for the
missing lines.

Task-3184727

Part-of: odoo/odoo#112806
2023-05-04 19:09:55 +02:00
Patrick Hoste 3c5d9e8e1d [REV] base,auth_password_policy: add form view for changing password
This reverts commit 14d97ec2
We revert this to keep the same design when changing password for
one or multiple users.

Task-3184727

Part-of: odoo/odoo#112806
2023-05-04 19:09:55 +02:00
Vincent Schippefilt 7d276aa941 [IMP] web: add reference fields to web_read
add support for fields of type `reference` and `many2one_reference` to `web_read` and `unity_web_search_read`

for both you can add a field_spec requesting fields of the "co-model":

request:
```python
{
    #reference
    'field_reference':
        {
            'fields': {'write_date': {}},
        }

    #many2one_reference
    'm2o_reference_id':
        {
            'fields': {'display_name': {}, 'write_date': {}},
        },
    'm2o_reference_model': {}
}
```
response:
```python
{
    'id': ...,
    #reference
    'field_reference': {
        'id': {'id': 3, 'model': 'comodel_name'},
        'write_date': '2004-11-23 11:30'
    }

    #many2one_reference
    'm2o_reference_id': {
        'id': 3,
        'display_name': "special first day",
        'write_date': '2004-11-23 11:30'
    },
    'm2o_reference_model': 'comodel_name',
}
```

closes odoo/odoo#119995

Task-id: 3284222
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-05-04 00:46:53 +02:00
Stanislas Sobieski 7496a710b9 [FIX] cloc: avoid memory issue on big file
Before this commit:
Files that should be ignored in the manifest but aren't (js library for example)
it can happen that files have huge lines, the regex to substract the
comments will overuse memory.
For example, a file of 13M with a line of more that 8M characters, the
memory consumptions peak at 1.7G

The results might be different, but it's an acceptable compromise

closes odoo/odoo#120376

X-original-commit: 63b13af2e49a83168d4304a06b6489c4b86eabf6
Signed-off-by: Thibault Francois <tfr@odoo.com>
2023-05-03 13:57:17 +02:00
xO-Tx c99cd92c14 [FIX] website, tools: make select options translatable
Steps to reproduce:

- Go to a website page > Add a 'Form' block > Add a new 'Selection'
field.
- Go to the page (in 'edit_translations' mode) > The selection field
options are not translatable.

The goal of this commit is to make the select options translatable
by adding an intermediate `.o_translation_select` element.

This element will handle option's text translations from the linked
`<select/>`. The final values are copied to the original element
right before save.

opw-3233360

closes odoo/odoo#120363

X-original-commit: 5ff53d7f289ec531f8369a47d02bd58252bb98a5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-05-03 13:57:08 +02:00
John Wilson bb1d9e7b26 [FIX] tests/common: Fix tests on Windows and with Debian release
closes odoo/odoo#120297

X-original-commit: 26c6997d8de5679307485cd8efb6b2ce5662f34c
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-05-03 12:39:53 +02:00
Michael (mcm) 517d3258f2 [REF] web,*: add dependencies param to odoo.define
This commit makes the `dependencies` param of
`odoo.define` mandatory. It was optional and when
omitted, a regexp read the function to find the
dependencies. We can simplify it now almost all js
modules have been converted to esm.
The transpiler already adds the param for the es
modules except if the module has an alias.

task id: 3271352

closes odoo/odoo#119145

Related: odoo/enterprise#40040
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-05-03 12:39:30 +02:00
Christophe SimonisandAlvaro Fuentes 6c2a487ef9 [FIX] core: consider x.y.z upgrade scripts as majorless
Also warn about invalid version numbers in upgrade scripts.

closes odoo/odoo#118420

Related: odoo/enterprise#39698
Related: odoo/upgrade#4554
Signed-off-by: Christophe Simonis <chs@odoo.com>
Co-authored-by: Alvaro Fuentes <afu@odoo.com>
2023-05-02 18:06:44 +02:00
Christophe Simonis 653ec8cf60 [IMP] core: enforce format of module versions
As module versions can be single digit, an upgrade script for version
`x.y.z`, is currently parsed as an upgrade script for module
version `z` in Odoo `x.y`.
However 3-digits module versions are more common than single-digit ones
and developers may expect the `x.y.x` upgrade scripts to be major-less
scripts.
This ambiguity can lift off if we accept module versions to be **only**
2-digits or 3-digits. This however make the `x.y.z` upgrade script
major-less. This can be fixed by renaming the script to `x.y.z.0`.

Part-of: odoo/odoo#118420
2023-05-02 18:06:44 +02:00
Fabien Pinckaers 6d102d4ee4 [IMP] base: better copywriting for 'neutralized'
closes odoo/odoo#120263

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-05-02 15:59:10 +02:00
Mathieu Walravens 1d87710fdc [FIX] http: rewind file upload on serialization failure
Before this commit:
When uploading a file, if the transaction fails due to a serialization
failure, Odoo will retry the request. However, if a file upload is read
during the transaction, the file pointer will be at the end of the file,
and calling `.read()` again returns an empty bytes object.

After this commit:
Upon retrying the request, rewind uploads to the beginning of the file,
if the file supports it.

opw-3228200

closes odoo/odoo#120180

X-original-commit: ac59ef0668122ad71dffbb5575250c767a0a56ec
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-04-28 20:29:55 +02:00
Rémy Voet (ryv) 302c7baa87 [REM] core,*: remove name_get_uid parameter from _name_search.
`name_get_uid` is unused (at least since v14) and the
documentation about it, is wrong.

closes odoo/odoo#117819

Related: odoo/enterprise#39483
Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-04-28 16:04:27 +02:00
Vincent Schippefiltandrco-odoo f916298bdf [FIX] base: do not fetch computed field already in cache
Before this commit if a computed field is already in cache, but not its
dependencies, `fetch` would fetch those dependencies.
This commit ensures that fetch checks first if a computed is in cache
before fetching its dependencies.
This commit also follows dependencies of computed fields, if they depend
on other computed fields.
Finally, this commit consolidates `fetch` and `search_fetch`:
they should use the same heuristics to know which fields to fetch.

closes odoo/odoo#120001

X-original-commit: 6b680c463956f929db10d4c3058c36112a67e674
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
Signed-off-by: Raphael Collet <rco@odoo.com>
Co-authored-by: rco-odoo <rco@odoo.com>
2023-04-28 14:44:05 +02:00
f5e6494da3 [IMP] web: introduce onchange2
The purpose of onchange2() is to adress two shortcomings of onchange():
 - reduce the payload of the RPC call by minimizing the diff
 - use the "unity" format for returning the data

Because of the dependency of onchange2() on web_read(), the new method
has been introduced in module web.

closes odoo/odoo#119510

Signed-off-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Julien Castiaux <juc@odoo.com>
Co-authored-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2023-04-28 14:44:00 +02:00
Raphael Collet 0167ac5f0c [FIX] base: res.bank.name_get() not working on new records
Part-of: odoo/odoo#119510
2023-04-28 14:43:59 +02:00
Raphael Collet 664dc3f8fb [IMP] test_new_api: add test on first call to onchange()
Part-of: odoo/odoo#119510
2023-04-28 14:43:59 +02:00
Jeremy Kersten 855da5757f [IMP] base: widget currency, allow to force decimal_places
This commit allow to add in t-options the decimal_places.
It is useful in case all price are without decimal e.g.

closes odoo/odoo#120036

X-original-commit: 800d18f2e9f94c68ebca281c9956abb23e7e33e6
Signed-off-by: Thibault Francois <tfr@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-04-28 08:57:58 +02:00