Commit Graph
6443 Commits
Author SHA1 Message Date
Thibault Delavallée 023bc67327 [IMP] mail: introduce a batch version of Partner._find_or_create ()
Purpose is to be able to create find or create partners in batch based on a
list of emails. When sending email in batch, notably using templates, doing
sequentially a search or create for each potential email to contact is not
efficient from computation point of view. This commit introduces a new batch
method for that purpose.

If no valid email is found for a given email, it is used as it to try to
find partners with same invalid email and/or keep the value in order to
allow updating it afterwards. Notably with notifications resend it is
possible to update emails, if only a typo prevents from having a real
email for example.

Falsy emails do not create partners as those have no real interest.

Task-3034875 (Mail: Speedup and batch partners find or create with templates)
Prepares Task-2088884 (Mail: Use editable computed stored fields in composer)

Part-of: odoo/odoo#99482
2023-01-17 20:58:33 +01:00
Thibault Delavallée 3e7acff8d9 [FIX] website(_sale): fix logs coming from website forms
Purpose of this commit is to avoid html entities in logged message by correctly
managing enclosures. For that purpose a new tool 'nl2br_enclose' is added that
eases Markup management on top of 'nl2br' simple tool.

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:31 +01:00
Thibault Delavallée eccac1ce7b [FIX] website(_sale): stop creating message manually
In website(_sale) messages are created from website forms. However those
are technical models, you should always use the MailThread API notably to
ensure values coherency. In our case using message_log seems to be what
original committers wanted to do (even creating a message as a comment
which has no effect as the notification process is not called that way).

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:31 +01:00
Thibault Delavallée 04a6b74d09 [FIX] mail, various: update query counters
Update counters according to latest runbot counters. It allows to better spot
side effects of upcoming changes.

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:30 +01:00
mehjabin aa1d5ca617 [FIX] base: make action name translatable
before this commit, the action name was not translatable to user language.

after this commit, action name will be shown in user's language.

closes odoo/odoo#110090

X-original-commit: 98fdef318968ae0ee81532c691ca5b372975d486
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-17 11:34:35 +01:00
Martin Trigaux eaa39012ba [FIX] base: allow calling install_lang in RPC
This method is used in Transifex synchronisation scripts and needs to
be called in RPC.
It was the case before 727ef9e0a2ca9308

closes odoo/odoo#110087

X-original-commit: 3b7e4535d358e554f7b089828efb82bc6b0a40e3
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-17 11:34:25 +01:00
niyasraphy 6faad52256 [FIX] base: index_content field alignment in attachment form
before this commit, the index_content field in attachment form view, is not taking full available space.

after this commit, the colspan="2" is added and field will be shown in full width

closes odoo/odoo#110037

X-original-commit: c11dcf88abe2d1e15d174d71e80ff48f50faa3c2
Signed-off-by: Julien Castiaux <juc@odoo.com>
2023-01-17 02:02:26 +01:00
Nicolas (vin) 8ed53c5a57 [FIX] base: ir ui views word break
Fix an issue in the form view of the ir ui view where,
in the edit view dialog, the right group labels would be
all squished up if the xml_id of the view is long.
E.g. the bank reconciliation view.

This is fixed by adding the text-break class to the field.

Task id # 3133662

closes odoo/odoo#110039

X-original-commit: cd1a75f6e9349d8a9ff59c4e65e1d52403e531e9
Signed-off-by: Julien Castiaux <juc@odoo.com>
2023-01-17 01:10:12 +01:00
Victor Feyens 1a1ce16265 [IMP] core,*: check routes decorators
When overriding an existing controller route, developers can
easily c/p the route definition and call super() in the overridden method
when the route attributes are automatically deducted by odoo from the parent route.

Removing those redefined attributes simplifies the routes definition,
clearly highlighting what's changed by the override.
Also reduces unexpected behavior when modifying the base route without
noticing/considering the redefined attributes in a overridden route,
which overrides the changes made to the base route when the sub-module is installed.

This commit adds a test to catch routes attributes redefinition, and clean existing routes.

closes odoo/odoo#108512

Related: odoo/enterprise#35176
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-16 19:45:57 +01:00
aliya aebd1a2c7e [FIX] base: add kz to EEU country group
EEU is missing KZ among the member countries, this commit fixes this omission.

closes odoo/odoo#109936

Signed-off-by: William André (wan) <wan@odoo.com>
2023-01-16 18:14:56 +01:00
Christophe Monniez 8e6e200477 [IMP] core: bump master release to 16.2 alpha 2023-01-16 17:00:48 +01:00
Xavier-Do 823d9e10dc [IMP] models: warn if constraint key len exceed 63
Warn when constrains name combine with table name will be more than
63 characters.
This is to avoid case like the one fixed in #103148

Unlike index, since constrains name are defined in the code, we prefer
to avoid automatic truncate and add a warning since devs can chose
an appropriate short-enough name.

The linked fixes will just truncate the name to the max length
to match the name in existing databases. Renaming could be done in other
pull requests with upgrade scripts to avoid constrains re-computation.

Part-of: odoo/odoo#109065
2023-01-16 09:32:51 +01:00
Robert Coleman 4fab501a25 [IMP] base: add vat_label to New Zealand
VAT in New Zealand is called GST. New Zealand entities are issued IRD numbers and when registered for tax their IRD number is used as GST number.

> from: https://www.business.govt.nz/tax-and-accounting/basic-tax-types/gst

> For sole traders, your GST number will be the same as your IRD number.
> For partnerships and companies, it’s the same as your partnership or company IRD number.

GST number is legally required on all tax invoices (https://www.ird.govt.nz/gst/tax-invoices-for-gst/how-tax-invoices-for-gst-work)

I have added the VAT label as IRD/GST so that it's clear wherever else VAT label is used that the same number fits both contexts (rather than introducing a second field for identical data through NZ l10n).

closes odoo/odoo#109800

X-original-commit: 8ac78c222ae93e000a43c71ac9e359a8542f8cff
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-01-13 17:32:41 +01:00
Benoit Socias 0bc3ae0ed5 [FIX] base: ignore spaces around text content when matching translation
When the same text appears several times inside a translated field but
nested in different HTMLs, the matching for each one is done
independently if various spacing appear in the HTML.

This commit strips the spaces around the matched texts so that texts
that are synchronized on purpose do not become desynchronized.
Doing this leads to collisions on the keys of `text2term`, it therefore
also has to replace it with a dictionary of text to list of terms.

opw-3098819

closes odoo/odoo#109798

X-original-commit: 6cec590a2dad43063d3bb747838393a8df13aa04
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-01-13 17:32:35 +01:00
niyasraphy fee5e773d1 [FIX] l10n_lt_reports: updating module name with country name
currently the module is named as LT, where as it has to be Lithuania according to odoo localization module standards

closes odoo/odoo#109240

X-original-commit: 84291b92655a260bd75669466c8f66d421fa3e7b
Related: odoo/enterprise#35488
Signed-off-by: Laurent Smet <las@odoo.com>
2023-01-13 16:27:57 +01:00
Julien Castiaux bf4c5015ce [IMP] core: make some cookies expire on logout
Some cookies were left around even when the user logged out

The next user should log into the default company instead of the company
of the last user.

task-3077421

closes odoo/odoo#108998

Related: odoo/enterprise#35685
Signed-off-by: Julien Castiaux <juc@odoo.com>
2023-01-13 16:27:35 +01:00
Victor Feyens be97280b82 [FIX] base,product,sale: currency checks in tests
Since https://github.com/odoo/odoo/commit/3752b3166ec6bbb5c6ea55f96bb521381bf2b2d9,
the currency of the test architecture is not fixed anymore to USD (but is by default).

Therefore, the nightly runbot tests of the localization (l10n_* modules) all fail
when verifying the company currency is USD (because the localization sets the company
currency to the country one).

This commit adapts those checks to stop enforcing the USD currency as base,
only enforcing that the currency used is the company one.

closes odoo/odoo#109807

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-12 19:09:00 +01:00
Jordan D. (Joda) a57b214c7d [FIX] tools: add SQL comparaison to fix module translation
When installing both documents and fleet and then, add a translation to
the database. Both fleet and document will be translated the same way.
This is due to the fact that both of them share a lot of similar value
inside of the PSQL database.

opw-3120320

closes odoo/odoo#109700

X-original-commit: fff53f845398ee0f8632cf7cb392f108388f3dc4
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2023-01-12 12:27:10 +01:00
Samuel Degueldre b34429b984 [IMP] web, test_lint: forbid private class fields
We don't want private class fields to be used in Odoo because they limit
how classes can be patched from the outside, extensibility is one of
Odoo's biggest strength and we do not want to limit it.

This commit adds the `no-restricted-syntax` rule to eslint configs with
a rule that forbids private class fields.

closes odoo/odoo#109664

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2023-01-11 17:58:41 +01:00
Jesús Alan Ramos Rodríguez 325d576fe9 [FIX] base: fix incorrect call of method of dictionary
This PR fixes an issue introduced in commit https://github.com/odoo/odoo/commit/b9feebc25cc8caad97e5c3cb2953643bfd14984f

When this line is executed, the following error is shown:

closes odoo/odoo#109652

Attributeerror: 'dict' object has no attribute 'vals'
X-original-commit: f3b6225e268711e3d9e6f6fda24f398e2f506259
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-01-11 17:58:36 +01:00
Ivan Yelizariev 4ca947c092 [FIX] base,web: fix address widgets in reports for RTL
This reverts following commits
1. a63f616c280ff464e331e3ba97265a8c29a86871
2. 5b7c3805a0

Instead of aligning address to left, we use default aligning, i.e. align to the
right for RTL langugages.

Commit n.1 was an attempt to finalize idea of the commit n.2, but it turned out
that left aligning looks just too bad for rtl users. So, this commit reverts
both of them, but keeps span/div changes in commit n.2

opw-3053457

closes odoo/odoo#109634

X-original-commit: 4af9fcf99f118e5dd85fb59d2e63f5b817233f07
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-01-11 14:31:03 +01:00
JF Aubert 0cdf410a44 [IMP] mrp: Remove mrp.immediate.production model
closes odoo/odoo#108446

Task: 3094741
Related: odoo/upgrade#4163
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-11 13:20:48 +01:00
Rémy Voet (ryv) 880daf6e59 [REM] base: remove useless module_nr field of ir.module.category
The last usage was an unused tree, previously removed.

closes odoo/odoo#109420

Related: odoo/enterprise#35586
Related: odoo/upgrade#4192
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2023-01-10 18:54:48 +01:00
Rémy Voet (ryv) 782fb61a3b [REM] base: remove useless list view of ir.module.category
The tree view `view_module_category_tree` was unused, remove it.
The form view (`view_module_category_form`) of `ir.module.category` is
still used in the `view_groups_form` view.

Part-of: odoo/odoo#109420
2023-01-10 18:54:47 +01:00
Rémy Voet (ryv) 2e2ca3dac0 [REM] base: remove useless field field_parent of ir.ui.view.
This field is useless since 905e01921f.
Remove it and all occurence of it in view records.

Part-of: odoo/odoo#109420
2023-01-10 18:54:47 +01:00
Rémy Voet (ryv) f9dc7e2698 [REM] base: remove deprecated methods of ir.ui.view
Since https://github.com/odoo/odoo/pull/87522 (landed in v16),
`fields_view_get`, `_fields_view_get` and `load_views` are deprecated.
Remove it for maintenance (and it is the last usage of
the useless field `field_parent`).

Part-of: odoo/odoo#109420
2023-01-10 18:54:47 +01:00
Kartik Chavda 3cd30d1531 [IMP] web: add default_group_by in list view
Before this commit it is not possible to add default
groupBy in list if users want default groupBy a list
then they have to pass default groupBy in action and
passing default groupBy in action groupBy other views
in action, so priorer to this commit users cannot add
default groupBy in list view without impacting other
view.

In, this commit add default_group_by in list view
attribute so users can add default groupBy in list
view without impacting other views in action.

task-3084850

Part-of: odoo/odoo#109281
2023-01-10 15:43:10 +01:00
Aaron Bohy d9b812d3f9 [FIX] base: allow t-debug directive in arch validation
Commit [1] added a whitelist of qweb directives that can be used
in qweb-based views (e.g. kanban). We forgot to allow the `t-debug`
directive, which obviously doesn't make sense in production but is
useful for debugging purposes.

This commit adds that directive to the whitelist, s.t. one can now
edit the view in xml or directly from the interface to add a
`t-debug`. Moreover, we add a test to ensure that we don't forget
a `t-debug` in an arch when we commit.

[1] 7fd5cec72b

closes odoo/odoo#109493

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-01-10 11:23:30 +01:00
Thomas Lefebvre (thle) c61a1a4789 [FIX] base: inherit the industry field from parent
Steps to reproduce:
   - install "contacts" and "sale_management" module;
   - create a company contact with a value for "Industry" (Sales & Purchase tab);
   - create an employee who works in this company;
   - create two orders (one with the company and one with the employee);
   - go to sales reporting tab and select the pivot view;
   - filter by "Customer Industry" and then by "Customer";

Issue:
   The employee is not placed in the right category of industry. He should be in the same category as the company he works in.

Cause:
   When creating a contact, the `industry_id` field is not passed from parent to children.
   (Moreover, this field being invisible for an "individual" contact, it is not possible to give it a value without using the studio application.)

Solution:
   Add `industry_id` to `_commercial_fields`.

opw-3085032

closes odoo/odoo#109313

X-original-commit: 60962062aefd34c911385f671c56b03836b3025a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-01-09 07:57:38 +01:00
Denis Ledoux d814c9bee4 [IMP] base: constraint to check view root node is matching the view type
This PR follows odoo/odoo#108073

Just ensure the root node of the view architecture matches
the view type.

e.g.

Valid:
```xml
<form>
...
</form>
```

Invalid:
```xml
<data>
  <div>
    ...
  </div>
  <form>
    ...
  </form>
</data>
```

closes odoo/odoo#108525

Related: odoo/upgrade#4155
Related: odoo/enterprise#35501
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2023-01-06 15:32:55 +01:00
Aaron Bohy 7fd5cec72b [IMP] base: view validation: detect js implementation details
This commit adds checks in the view validation, to detect the use
of implementation details in archs. The goal is to prevent people
from using owl directives in archs (e.g. t-on-click). Recall that
a view arch isn't an owl template, it must follow the DSL of the
given view type.

In kanban, gantt and activity archs, using `t-xxx` attributes is
forbidden, except for directives historically supported by qweb
(e.g. `t-esc`).

In other views, using `t-xxx` attributes is forbidden (except for
`t-translation`).

In all views, using attributes `data-tooltip`, `data-tooltip-template`
and `data-tooltip-info` is forbidden.

Task 3085357

closes odoo/odoo#107083

Related: odoo/enterprise#35352
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-06 15:32:47 +01:00
duongnguyen b17533c9f9 [FIX] base: fix test failing when sources are not in a folder named
'odoo'

-EX: odoo addons path is '~/odoo15/odoo/...' or '~/15.0/odoo/...'
Basically not start with 'odoo' it will get error when running tests
case on this file

closes odoo/odoo#109135

X-original-commit: 336b966f7959b4a5e716b58b25ab13d7e3f92691
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-01-06 11:25:02 +01:00
Julien Castiaux e7b0e0bd70 [FIX] base: missing MIME-Version header
Send an rich HTML email from Odoo, it lands in spam whereas it would
land in inbox in 13.0.

The problem is due to a missing "MIME-Version: 1.0" header on the email.
This header is correctly set on both the html and text alternatives of
the messages but it should be set on the enveloppe too.

The problem is present in the newer EmailMessage mail API of python that
is used since 14.0. Using the newer API, it doesn't set the header on
the enveloppe itself.

This reverts commit 8663f1e20727c315924bb20fc1de1accf3014c61.

opw-3098621

closes odoo/odoo#109212

X-original-commit: c480d2bf1de7b70892130e74bb7a8d4003a8a783
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Julien Castiaux <juc@odoo.com>
2023-01-05 19:41:04 +01:00
Jorge Pinna Puissant 5b68871097 [IMP] * : kanban, unify dropdown definition in archs
This commit separate the templates, one for the card and another one for
the menu (the ellipsis dropdown).

The new template, called 'kanban-menu', will only contain the dropdown.
Note that, this behaviour is the same as the one used for the kanban
tooltips.

closes odoo/odoo#107589

Task-id: 3096776
Related: odoo/documentation#3284
Related: odoo/enterprise#34962
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-05 15:37:04 +01:00
Julien Castiaux 145b44fa57 [FIX] core: cannot read country geoip on city db
Start odoo-bin shell with `--geoip_country_db='/i/dont/exist'` and type
the following code:

    from odoo.http import GeoIP
    GeoIP('8.8.8.8').country_code

TypeError: The country method cannot be used with the GeoLite2-City
database

There are two "things" here: the raw country and city entries in the
databases and the rich python country and city objects returned when an
entry was found and parsed.

Then there are two "readers", a reader capable of reading and parsing
entries from the city database and **another** reader for the country.
The two readers are **only** compatible with their specific database:
the city reader cannot read or parse information from the country
database and vis-versa. That's the bug reported by the TypeError that
this commit fixes.

But, the two python instances created from parsing the entries of
respecting databases with respecting parsers **do** share a same API:
the city record class inherits from the country record class.

    # Valid
    city_db = geoip2.database.Reader(config['geoip_city_db'])
    city_record = city_db.city('8.8.8.8')
    city_record.country.name  # works, a city record also
                              # holds country attributes

    # Invalid
    city_db = geoip2.database.Reader(config['geoip_city_db'])
    country_record = city_db.country('8.8.8.8')  # TypeError

closes odoo/odoo#109095

Signed-off-by: Julien Castiaux <juc@odoo.com>
2023-01-05 11:35:55 +01:00
Lucas Lefèvre 195dcdacb8 [REM] base: remove useless board menus
`menu_board_root` is not used anymore since 37f16fb

`menu_reporting_dashboard` and `menu_reporting_config` seem ununsed
since a long time.

Task 3119613

closes odoo/odoo#109041

Related: odoo/upgrade#4172
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2023-01-05 10:30:56 +01:00
aliya 85de8a8f9c [ADD] l10n_kz: add l10n_kz accounting localization
Adds a Chart of Accounts, taxes, and a demo company for Kazakhstan.
- The Chart of Accounts is added according to the official documentation:
  https://adilet.zan.kz/rus/docs/V070004771_
- The Tax report is added according to this documentation:
  https://adilet.zan.kz/rus/docs/V14E0010156

task-2693102

closes odoo/odoo#105399

Related: odoo/enterprise#33941
Signed-off-by: William André (wan) <wan@odoo.com>
2023-01-05 09:30:04 +01:00
niyasraphy 23bc24873d [ADD] base: add Malayalam language
closes odoo/odoo#109027

X-original-commit: 7d189be63fa9b126ea93cc2d7c3433c50b6b0d89
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-03 20:15:14 +01:00
Michael (mcm) e089cda98d [IMP] web,*: rename Create button to New
*calendar,test_main_flows

This commit tries to unify the name of the create buttons in different
apps. "New" is used over "Create" to avoid confusion regarding its effect.
"Create" could be interpreted as we want the current record to create a new one.
But "New" implies that the user will land on an empty page that can be filled.

task id: 3074472

closes odoo/odoo#108439

Related: odoo/enterprise#35139
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-01-03 16:13:44 +01:00
Julien Castiaux 3d1f486bcc [IMP] *: update modules to use the new geoip API
request.geoip is no more a dictionnary cached in the session. It is now
a full blown object with lazy and smart geolocalisation capabilities.

Among other things, the previous dictionnary API is now deprecated. The
changes are:

* `request.geoip['country_name']` -> `request.geoip.country_name`
* `request.geoip['country_code']` -> `request.geoip.country_code`
* `request.geoip['city']` -> `request.geoip.city.name`
* `request.geoip['latitude']` -> `request.geoip.location.latitude`
* `request.geoip['longitude']` -> `request.geoip.location.longitude`
* `request.geoip['region']` -> `(request.geoip.subdivisions[0].iso_code if request.geoip.subdivisions else None)`
* `request.geoip['time_zone']` -> `request.geoip.location.time_zone`

It is safe to access all the attributes. Doing `request.geoip.city.name`
when the geolocalization failed (missing db, invalid address, ...)
evaluates to None. It does not raise an AttributeError.

Task: 2848206
Part-of: odoo/odoo#91337
2023-01-03 13:16:02 +01:00
Julien Castiaux c59750d824 [IMP] core: smarter geoip
Maxmind offers multiple ip-geolocalization databases, historically we
have been using the City database which contains records on a
city-basis. Many years later it turns out we are primary using geoip to
know the country of the user. Geolocalization in the City database is
considered slow by our standard and we have been clever in order not to
geolocate each request by saving the info in the session.

On the other hand, the Country database that is offered by Maxmind is
much more lightweight and geoip using that country is considered a fast
operation by our standard.

In this work we make Odoo compatible with both the City and the Country
databases. Using multiple database at the same time, we can be smart and
only query each of the two on-demand. If a user ask for its country,
we'll use the fast Country db. If a user ask for its city/timezone we'll
use the slower City db.

By default it loads both database from the `/usr/share/GeoIP/` folder,
respectively the files `GeoLite2-City.mmdb` and `GeoLite2-Country.mmdb`,
you can provide alternative paths using the `--geoip-city-db` and
`--geoip-country-db` CLI options.

In the same mindset as #86015, geoip is still lazy. It is done on-demand
and the result is cached on the current request. The different with the
related PR is that as we know consider geoip to be fast, we no longer
cache the result in the session.

Task: 2848206
Part-of: odoo/odoo#91337
2023-01-03 13:16:02 +01:00
Nshimiyimana Séna 3aeed55764 [FIX] tools: recognize SVG with explicit namespace
Currently, odoo's mimetype guesser does not recognize SVGs with explicit
namespace.

closes odoo/odoo#108938

X-original-commit: a1257cad9d5a63d940da041f355c13ea3eba90ce
Signed-off-by: Julien Castiaux <juc@odoo.com>
2023-01-02 20:39:49 +01:00
niyasraphy 2a32cdc3cf [IMP] base: add form view for ir.actions.client model
before this commit, there is no form view defined for the ir.actions.client model, so opening the form view of this model returns the odoo auto created form view, which is not looking good in ui.

the form can be opened by clicking on Edit Action button in the debug tool from a client action menu like Discuss

closes odoo/odoo#108829

Signed-off-by: Julien Castiaux <juc@odoo.com>
2023-01-02 17:48:44 +01:00
Raphael Collet f2115ba0f2 [FIX] core: don't fail when reading recordset with ids [None]
The revision 65a012c2bba0ed81d9b525a7779c726043b17707 changed the
behavior of method _read() when invoked on a record with id None.
Before the change, the method would consider that no records have been
fetched because the id is falsy.  After the change, it keeps the id None
in the fetched records, and attempts to make subsequent SQL queries like
"column IN ()", which is syntactically incorrect.

OPW 3104957

closes odoo/odoo#108785

X-original-commit: 712d03cb2ee5f2fde0e80619be5db38aa09ed1ac
Signed-off-by: Rémy Voet <ryv@odoo.com>
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-12-29 11:55:57 +01:00
Ivan Yelizariev 3331514b16 [FIX] base: prevent using "reload" as Home Action
Home action is first action to do on opening Odoo. Usually, it's an action to
open specific menu. The `action_id` field doesn't have domain and user may
select any action. This commit prevents user selecting action with "reload" tag,
because it would lead to infinite page reloading.

STEPS:
* Set `Open POS Menu` as a Home Action
* reload the page

opw-2900439

closes odoo/odoo#108729

X-original-commit: 5f689f73ca1b5c366cc94af4b84933f9e98a4314
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2022-12-29 10:04:03 +01:00
amdi-odoo 2a015600b2 [FIX] web,auth_totp,base: fix 2FA views
Web:

Adding a css rule constraint to avoid the rule
from overwriting the o_field_highlight css class
applied on a field in a form view.

Base, auth_totp:

Adding the o_field_highlight class on the 2FA
form fields to display the input bottom border and
thereby more easily identify the fields.

Adding a placeholder to the 2FA password field.

Modifying the 2FA title and toggle font to keep
a consistency between the different page titles.

Task-3083540

closes odoo/odoo#108611

X-original-commit: c128a01490bbbcbf824781f5e8716aa30e65ba5b
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-12-26 11:39:47 +01:00
Nshimiyimana Séna 68f1529490 [FIX] tools: set correct mimetype for XML files
Currently, the mimetype detection for XML files always returns
`image/svg+xml`.

opw-3062131

closes odoo/odoo#108644

X-original-commit: 6ea9e75d5a14cfe4a846be69e05c3c18f1daffcb
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-24 02:35:46 +01:00
Pierre Masereel 4ac3fbc5e9 [FIX] base: ir_attachment override traceback
When the _search method is called with, it passes this argument
to the other _search call in it con concatenate it with the
result. But when the count argument is true, it tries to take a sublist
of an integer which raise a traceback.

So we explicitly call it with count=False

closes odoo/odoo#108634

X-original-commit: 5c12edb989a044d35e8be93b40fdc0e3a66379ed
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-24 02:35:43 +01:00
Samuel Degueldre a5c0889748 [IMP] odoo,web: tests: ease memory leak debugging
This commit adds (in comments) the necessary code to (more) easily
detect memory leaks in the qunit test suite. Running the test with
those lines uncommented would log information about the heap size
after each test module and the delta of the module, after garbage
collecting.

Useful regexes to extract information from the log:
```
remove lines not containing "delta: ":
`(^.*?delta: .*$\n)|(^.*$\n)` => $1

extract deltas:
`.*suite (.*) -.*gc: (\d+).*delta: (-?\d+).*` => $1,$2,$3
```

closes odoo/odoo#108620

X-original-commit: 0d5cb1659468f01f1b6f88deca0b46c1810111b0
Related: odoo/enterprise#35224
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-23 19:19:15 +01:00
Alexandre Kühn 7139ae416e [IMP] tools: put QUnit.only test in module wrap
Before this commit, when filtering tests by odoo module,
tests registered with `QUnit.test` and `QUnit.debug` were
listed, but not `QUnit.only`.

closes odoo/odoo#108591

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-12-23 15:08:18 +01:00