Commit Graph
100 Commits
Author SHA1 Message Date
Christophe Monniez c2c856abd9 [FIX] test_new_api: fix portal subtest without demo
The test_sudo_commands fails when testing portal user without demo data.
With this commit, a portal user is created in a setupClass.

closes odoo/odoo#163319

Build-error: 55927
X-original-commit: 83c2201543d4d37b2d8e760200c5b111e1d74fa1
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2024-04-25 17:06:58 +00:00
Christophe Monniez 5e3d9305aa [FIX] base: use demo user of the test class
closes odoo/odoo#163274

Build-error: 55926
X-original-commit: a5bda29fbeae7d929f65b026a1e7a8bab7f80da1
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2024-04-25 06:11:10 +00:00
Christophe Monniez 29fb4ac761 [FIX] base: fix similar attachments
While searching for a similar attachment, as the fallback url pattern is
the same as the url pattern, the condition is never satisfied.

With this commit, the ignore_params parameter is used to find a similar
attachment.

closes odoo/odoo#162654

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2024-04-22 17:04:37 +00:00
Christophe Monniez 66d2e285d6 [FIX] *: fix missed E0601
Fix various "Using variable xxx before assignment". It was not detected
by pylint <= 2.5.0 which was the version enforced on runbot.

closes odoo/odoo#160886

closes odoo/odoo#161166

X-original-commit: 328a0ce2fa619376672c591d8b4f8892aaa2da1a
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2024-04-09 19:35:41 +00:00
Christophe Monniez 8b8819c494 [FIX] sale_mrp, sale_mrp_margin: deduplicate tests
By inheriting from a test class that contains test methods, these tests
are executed twice.

closes odoo/odoo#150272

X-original-commit: 835f600eac6fd1ec202cd21876457b14d3d0af06
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2024-01-20 09:33:37 +00:00
Christophe Monniez 2c16088298 [FIX] barcodes_gs1_nomenclature: deduplicate tests
When inheriting from a test class having tests methods, the tests are
played twice. In this particular case, the inheritance was not necessary
at all.

closes odoo/odoo#150287

X-original-commit: 839fa009f3f032cb45c56acfe237933bf0fb69c9
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2024-01-20 08:22:27 +00:00
Christophe Monniez e4dc9a32db [FIX] mrp_account, stock_account: deduplicate tests
When a test case class inherits from another class that has test
methods, those tests are executed again for both classes.

While it could be done on purpose, it does not seems to be the case
here. Moreover, in this particular case, we are talking about 51 tests.
Also, as the child class is tagged `post_install` those tests are run
again on runbot in a post install build.

closes odoo/odoo#150028

X-original-commit: ee747ae5c68871d58647a263d54bb658ef43eece
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2024-01-20 02:42:59 +00:00
Christophe Monniez bbb126b7a5 [FIX] packaging: increase vm memory
When building the windows package, the build process can be accelerated
by increasing the virtual machine memory.

closes odoo/odoo#141730

X-original-commit: 88f2f374897f12c950b9f398715e3da8245332f6
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-11-12 07:49:06 +00:00
Christophe Monniez 252becef19 [FIX] base: 3.11 compatibility
Complement of the previous complement e2752a04ff (#137099)

Those opcodes were added in Python 3.11 and we missed them.

Fixes #140588

closes odoo/odoo#141015

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-11-07 15:12:48 +00:00
Christophe Monniez eae9980e0c [FIX] web: fix clickbot blacklisted menus for event
In f0b7838f the event_barcode was moved from enterprise to community, so
the menu for the registration desk changed. As this menu was blacklisted
in the clickbot, it started to fail in the nightly tests.

While at it:
  * remove useless and noisy log
  * log when a menu is skipped instead of telling that it was tested

closes odoo/odoo#140805

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-11-06 11:16:41 +00:00
Christophe Monniez 7094215e65 [FIX] web: skip clickbot qunit test
The clickbot test fails after October because of a hard coded month. It
needs to be refactored but let's skip it in emergency.

closes odoo/odoo#140641

X-original-commit: f9ec63dc3d865a24ec7da3f9389ce6b46fb66a83
Related: odoo/enterprise#49990
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-11-02 10:15:05 +00:00
Christophe Monniez dd05f0af20 [REL] 17.0 2023-10-26 19:39:28 +00:00
Christophe Monniez f194271823 [FIX] http: comply with rfc6265
Werkzeug changed the behavior of url_quote in
pallets/werkzeug@babfc93b38

Which appeared in Werkzeug 2.2.2 used in Debian Bookworm.

This change broke at least the export feature in Odoo. In summary,
the character set specified by [RFC5987] is more restricted than
that of [RFC3986]. So url_quote now allows invalid characters.

For example, a filename like `Journal Entry (account.move).xlsx`
leads to a crash of the client with Werkzeug 2.2.2.

url_quote is not really made to conform to [RFC6266] but we did not
find any [RFC6266] escaping tool in the standard library. This
commit explicitly specify as unsafe this list of chars.

[RFC6266]: https://datatracker.ietf.org/doc/html/rfc6266/ [RFC5987]:
https://datatracker.ietf.org/doc/html/rfc5987#section-3.2 [RFC3986]:
https://datatracker.ietf.org/doc/html/rfc3986/ [RFC2616]:
https://datatracker.ietf.org/doc/html/rfc2616#section-2

closes odoo/odoo#139483

X-original-commit: d145cb57eaf39fbe7612d4a79f209fc191828a8b
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-10-24 13:55:28 +00:00
Christophe Monniez 308854e4fc [FIX] packaging: build and test tgz from latest debian
The source packaging was a bit left behind, it was still using Debian
buster to build and test.

With this commit the Debian bookworm is used. As the installation of pip
packages as root is now forbidden, the build and tests are now using a
python virtual environment aka venv.

closes odoo/odoo#139482

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-10-24 13:55:27 +00:00
Christophe Monniez 2cea8b1450 [FIX] packaging: fix rpm tests
As [postgresql 15] changed the permissions of the public schema,
when testing the rpm package with Fedora 38, the test fails with
`InsufficientPrivilege: permission denied for schema public`.

With this commit, we properly create the database with the odoo user.
While at it, let's do the same with the poor left behind tgz package.

[postgresql 15]: https://www.postgresql.org/docs/release/15.0/

Part-of: odoo/odoo#139482
2023-10-24 13:55:27 +00:00
Christophe Monniez a05683fdd2 [FIX] packaging: force ofxparse install in rpm
When building the rpm package with Fedora 38, for an unknown reason, the
`python3-ofxparse` package refuse to be installed in the Docker image.

When specifying the `.noarch` specification the magic happens.

The reason remains obscure, nor I can't tell if it's linked to the
container itself.

Part-of: odoo/odoo#139482
2023-10-24 13:55:27 +00:00
Christophe Monniez 15b6cf888c [IMP] packaging: adapt packaging for current distros
As Odoo, now, needs at least python 3.10 have to build it against the
current distros.

closes odoo/odoo#136904

Related: odoo/documentation#5940
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-06 21:11:52 +00:00
Christophe Monniez 163fb3ae61 [IMP] core, requirements: bump minimal python version to 3.10
Now that the Debian 12 ("Bookworm") is out with Python 3.11 as the
default, it's time to update our requirements.

Reminder of the constraints for our requirements:

We try choose the smallest version from the Ubuntu/Debian corresponding
package (python3-...).

Also, if we find that one of the package was patched by the
Debian/Ubuntu maintainer, we choose the version from which the patch is
coming.

So, before this commit, the version were choose between Debian 11 and
Ubuntu 22.04. With this commit, we can simplify the requirements because
of a better matching between "Jammy" and "Bookworm".

About the choice of the python version:

* Ubuntu 22.04 ("Jammy") provides 3.10
* Debian 12 ("Bookworm") provides 3.11
* Some features that only exists in 3.9 will be needed in a near future
* 3.9 is a small release

Part-of: odoo/odoo#136904
2023-10-06 21:11:52 +00:00
Christophe Monniez 2f5d67471b [IMP] web: speedup the clickbot
closes odoo/odoo#133630

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-08-31 06:16:01 +00:00
Christophe Monniez 8ad3fa51ab [FIX] account,base: fix TestIrActionsReport
With Python 3.11, PyPDF2 2.12.1 is used and the exception raised when
the encryption type is not supported is now `NotImplementedError`
instead of `PdfReadError` in previous version.

In order to support both version, this commit adds a catche for the
`NotImplementedError` too.

closes odoo/odoo#133242

X-original-commit: effff7e00d8d410106e12e7ea42c8a875a11bb8b
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-08-28 11:24:43 +00:00
Christophe Monniez 13a4df94b1 [IMP] core: bump master release to 16.5 alpha 2023-07-20 22:44:13 +02:00
Christophe Monniez b94c99e3f6 [FIX] packaging: remove useless soft links
The Debian package is replacing some fonts by a soft link to the Debian
packaged ones.

The glyphicons-halfings were for bootstrap 3.x which is not used anymore
in Odoo, resulting in harmless broken links in the Debian package.

Closes odoo/docker#453

closes odoo/odoo#125840

X-original-commit: bcc681438ab3ed68a86ecbc4b38bd5384dda2b1d
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-07-10 08:56:19 +02:00
Christophe Monniez 50967f0486 [REM] packaging: remove windows 32 bit support
Since may 2020, M$ stopped to ship their 32 bits OS.
So, there is no need to distribute a 32 bit version anymore.

This will reduce the package size by 2.

The new package will use Python 3.10 by default, that's why the
local requirements were changed (a wheel package was missing for windows
in the previous version of PyKCS11).

closes odoo/odoo#124057

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-06-07 12:02:20 +02:00
Christophe Monniez 428b78e9bd [FIX] tests: move enter test_mode in setUpClass
Before this commit, the registry was entering test_mode in setUp,
leading to a hole during the setUpClass with a registry not in test mode
at this moment.

closes odoo/odoo#122585

X-original-commit: 993e4d2f98b9982eb64123d6cd0de8cc3b2056f4
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-05-26 10:29:22 +02:00
Christophe Monniez ba5087cc6d [FIX] link_tracker: changes test of render mixin to Httpcase
As this test navigates to some routes, it clearly should be an HttpCase.

X-original-commit: 8fa339a9c75be6055b1537402eca3060a4c9f701
Part-of: odoo/odoo#122585
2023-05-26 10:29:22 +02:00
Christophe Monniez ebd31deee5 [FIX] web: avoid calling terminate_browser
As the ChromeBrowser API was simplified in 2b0d9fa6a9, the
terminate_browser method was removed but the shiny author forgot to
remove the call in the click_everywhere test.

closes odoo/odoo#122038

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-05-23 14:52:16 +02:00
Christophe Monniez 8915ff5f83 [IMP] core: bump master release to 16.4 alpha 2023-05-17 16:01:14 +02:00
Christophe Monniez 76989ab5a7 [FIX] requirements: adapt leftovers packages for Jammy
As the original PR was forgotten, let's achieve the JCVD style big gap
beteween Ubuntu stable and Debian stable 11.6 Bullseye.

closes odoo/odoo#118889

X-original-commit: f21c159d9f0c1a3f3f1f3a013c7bf0fc8fa8b554
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-04-18 17:25:46 +02:00
Christophe Monniez e878843ee0 [FIX] requirements: fix jinja version for py 3.11
The pinned version of markupsafe for python > 3.10 is incompatible with
the pinned version of jinja.

With this commit, the Jinja version is pinned to follow Debian bookworm
version when python > 3.10 which should fix the issue.

closes odoo/odoo#117191

X-original-commit: 548d177e16f364b35f61f861df132dfcedc71e28
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-03-30 17:58:04 +02:00
Christophe Monniez e3bc2a90b5 [FIX] requirements: adapt for python 3.11
Although Odoo 16.0 was already adapted to work with python 3.11 in
67c7cea , the requirements were left untouched. The purpose of this
previous work was to prepare for the next Debian Bookworm release.

With this commit, the requirements are updated to match the python
packages versions from Bookworm. That way, it will allow people who
installs Odoo in Python 3.11 environments by using the requirements
should be able to do so.

Closes #114195

X-original-commit: fbe4932cd583a2cc019644807a7ea248d34eec80
Part-of: odoo/odoo#115618
2023-03-17 10:38:11 +01:00
Christophe Monniez 48fac32738 [IMP] core: bump master release to 16.3 alpha 2023-03-15 12:18:56 +01:00
Christophe Monniez dfe7bcecbf [FIX] account: adapt pypdf2 import for both versions
As PyPDF2 was bumped from 1.2.6 to 2.12.1 and made some breaking
changes, we made an attempt in 8e0564dff to have Odoo working with both
versions. This is necessary because of the imminent release of Debian
Bookworm that will provide PyPDF 2.12.1. In the meanwhile this import
broke the Bookworm nightly build.

While at it, let's remove the unused `textwrap` import.

closes odoo/odoo#113667

X-original-commit: 7431019b35ee71813ce8602f46ddc50a70c661ed
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-02-27 07:45:01 +01:00
Christophe Monniez cf565652c6 [FIX] website_sale: wait for the editor to be loaded
As the tour `shop_editor` is very small, it finishes before the editor
itself is fully loaded.

As a consequence, some threads are remaining on the server side and can
lead to a complete failure of the test.

This seems to particularly affects builds on Bookwork with werkzeug
2.2.2 and python 3.11 as it leads to werkzeug requests timeout.

With this commit, a step is added at the beginning of the test to ensure
that the editor is loaded before beginning the test by itself.

closes odoo/odoo#112698

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-02-24 10:06:14 +01:00
Christophe Monniez bc15040c8e [FIX] core: ignore usage of html parser for ofx files
The ofxparse module explicitly uses an html parser instead of xml but
since bs4 4.11.0, this triggers a warning.

closes odoo/odoo#113354

X-original-commit: e81ed97c9c54c69c68c54c69b4d3d80ed0515ae8
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-02-22 12:43:00 +01:00
Christophe Monniez 4bfe69d00d [FIX] tools: adapt test for babel 2.10 compatibility
Babel 2.10 (provided in Debian Bookworm) changed the `medium` format at
least for fr_FR and zh_CN.

This commit adapts the tests in order to work with both versions of
Babel. A custom format is used as our unit test is made to test that our
formating methods works, not the way the Babel formats.

X-original-commit: b77eb98bbf6bc937efb7941802c0794ae3622094
Part-of: odoo/odoo#113354
2023-02-22 12:43:00 +01:00
Christophe Monniez 650d8a116f [FIX] core: ignore urllib3 pyopenssl warning
X-original-commit: 160c8acdf6e50659ec316bb36df9ea9c996ba16d
Part-of: odoo/odoo#113354
2023-02-22 12:43:00 +01:00
Christophe Monniez bcf9ba01dc [IMP] base: adapt for PyPDF2 >= 2.0.0
X-original-commit: 8e0564dff20876105295a1efec0bc519f4bd1aeb
Part-of: odoo/odoo#113354
2023-02-22 12:42:59 +01:00
Christophe Monniez 7255819659 [FIX] mass_mailing: use a sequence for random sampling
Since Python 3.11, sampling from a set deprecated, the population must
be a sequence.

This commit applies the suggested fix.

Also, the filtering of the deprecation warning about sampling from set
can be disabled when the python version is not 3.9. This warning was
wrongly triggered since 3.9 because recordsets are bot a sequence and a
set.
This was fixed in python 3.10, see https://bugs.python.org/issue42470

closes odoo/odoo#112450

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-02-14 08:03:24 +01:00
Christophe Monniez 56bb6d5b32 [FIX] base: allow patching of config.options for 3.11
Since python/cpython#18544, unittest mock is not able to properly find
the "odoo.tools.config".

When trying to patch the `options` dictionnary, it leads to
`AttributeError: module 'odoo.tools.config' has no attribute 'options'`

In order to have the tests
working in python <= 3.11, we have to import the config module and patch
the options in place.

Part-of: odoo/odoo#112450
2023-02-14 08:03:23 +01:00
Christophe Monniez a3dffa86f5 [FIX] base, tools: use getlocale vs deprecated getdefaultlocale
As getdefaultlocale is deprecated in 3.11 in favor of getlocale which is
available since at least 3.0.

Part-of: odoo/odoo#112450
2023-02-14 08:03:23 +01:00
Christophe Monniez fab86bbf8b [FIX] web: adapt test for werkzeug >= 2.2.2
In werkzeug 2.2.2, the following characters "$!'()*+,;" are now
considered as safe by url_quote. This makes the filename_secure test
fail with the hard coded expected string containing a single quote as
'%27'.

This commit adapt the filename_secure test in order to work with all
versions of werkzeug.

closes odoo/odoo#112298

Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-02-10 14:37:31 +01:00
Christophe Monniez 442c776cb6 [FIX] test_website: remove base_url from assertions
Since Werkzeug 2.1.0, the Response.autocorrect_location_header is
disabled by default.

As it's RFC compliant and supported by browsers, the base_url is simply
removed from the assertions.

Part-of: odoo/odoo#112298
2023-02-10 14:37:30 +01:00
Christophe Monniez 25ab0c269f [FIX] website: allow status 308 in redirect double slash
When redirecting when a double slash appears in url, werkzeug >= 2.2.0
redirects with a status 308 instead of a 301.

Part-of: odoo/odoo#112298
2023-02-10 14:37:30 +01:00
Christophe Monniez 9df3110cc7 [FIX] core: fix import from werkzeug 2.2.2
In werkzeug 2.2.2, the NumberConverter class was moved in routing.
Needed as Debian Bookworm provides werkzeug 2.2.2.

See https://github.com/pallets/werkzeug/pull/2433

Part-of: odoo/odoo#112298
2023-02-10 14:37:30 +01:00
Christophe Monniez a5d878ab9b [FIX] packaging: fix installing deb package when user exists
When a odoo user already exists, the installation of the deb package
fails because the `/var/lib/odoo` directory does not exists.

The reason is that the postinst script is trying to change the
permissions of this directory which is only created if a odoo user does
not already exists.

With this commit, the permission changes only occurs when the directory
is created.

closes odoo/odoo#111877

X-original-commit: 8e1ebd8de01bc9d97e47572bc8b1d2eaafebf743
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-02-03 16:32:46 +01:00
Christophe Monniez 6890a0928d [FIX] web: replace invalid font for sign
closes #109361

closes odoo/odoo#110616

X-original-commit: 7be74d8232dd93789760893cecf9a8a74a9aad75
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-01-24 10:20:24 +01:00
Christophe Monniez c33bb655e6 [REM] web, project: remove mnmlicons font
The mnmliconsv21 is not used anymore for 7 years (see 660b13b)

Closes #6382

X-original-commit: 0f59b958fb9013bfd47ba16b36204bcbee731b72
Part-of: odoo/odoo#110616
2023-01-24 10:20:24 +01:00
Christophe Monniez 8e6e200477 [IMP] core: bump master release to 16.2 alpha 2023-01-16 17:00:48 +01:00
Christophe Monniez 37a8f27944 [FIX] packaging: set fedora 36 as base for rpm
Also, as the rpm is not built from the deprecated bdist_rpm anymore, it's
time to remove useless requires from the `setup.cfg` file.

On the other hand, the soft requirements in the `setup.py` are now
synchronized with the hard requirements.

closes odoo/odoo#102849

X-original-commit: 20920ae968d6d5d2e51c970e9a2536e55965c53b
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-10-10 17:11:31 +02:00
Christophe Monniez 9d7c2bc391 [FIX] payment: fix payment processing payment_redirect
Steps to reproduce:
- create and send a quotation
- make a failed payment (through cutomer preview)
- create and send a second quotation to the same customer
- make a succesful payment this time
- redirect takes to the wrong quotation (failed one)

Bug:
polling the processed payments initially returns both transaction
but the following polls only returns the rejected payment
(introduced in [1] processed transactions are filtered out)
since there's only a single transaction, redirect takes to it

Fix:
if there's only a single succesful transaction (regardless of the rest)
it means the current payment was successfull so we redirect to it

opw-2954162

[1]:https://github.com/odoo/odoo/pull/31741/commits/7612659565ee24f1c878b81e6c86b5780fbd5a3d

closes odoo/odoo#101252

X-original-commit: 6ea920d2573cf68c6a5cbaf1f6af31fd7de155ff
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2022-09-27 13:48:44 +02:00
Christophe Monniez c14c618ec9 [FIX] packaging: install productivity apps only in installers
closes odoo/odoo#101043

X-original-commit: 4fadf6b99a7b48a58a612e3d0be3d14a99a60ef5
Signed-off-by: Olivier Dony <odo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-09-26 07:42:57 +02:00
Christophe Monniez 6d565447e2 [FIX] packaging: fix windows installer requirements
When building the windows installer, the requirements are installed one
by one to avoid a complete crash when a requirement is not installable
on windows.

It appears that lines that contains comments are not installed.

With this commit the comment part is properly removed from requirement
lines when calling pip.

closes odoo/odoo#100820

X-original-commit: 8c175db723ca2215526f766bb2e2c6fd08970c37
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-09-23 01:39:46 +02:00
Christophe Monniez d7ec624d5a [IMP] core: bump master release to 16.1 alpha 2022-09-21 08:45:40 +02:00
Christophe Monniez c754838489 [FIX] web: fix clickbot click timeout inconsistency
The clickbot click default timeout was increased in #98495, but missed
the fact that the default was overridden for the "Settings" menu to a
lower value.

With this commit, the "Settings" exception is completely removed as the
default timeout is higher. Also, checking that the text contains
"Settings" was a bit weak.

While at it, the timeout for the global testing of an app is also
increased to 10 minutes instead of 5 as this limit is reached by the
Field Service app.

closes odoo/odoo#98617

X-original-commit: 0247e6f4abef4121b451c1373ae3c1ce184451c0
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-08-23 08:50:01 +02:00
Christophe Monniez 734debfb3a [FIX] web: increase clickbot click timeout
It happens that some pages are exceeding the click timeout of ten
seconds. Notably the settings, and as the settings are linked to
different menu's, it's difficult to black-list them.

closes odoo/odoo#98525

X-original-commit: 26665a5055842a40f3beb718bd63546758f190f4
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-08-20 13:40:36 +02:00
Christophe Monniez 5000f5b05d [FIX] tests: clear session storage in test browser
closes odoo/odoo#94756

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-06-28 16:03:17 +02:00
Christophe Monniez 00d36ec929 [FIX] core: decrement master release version
Even though the release process changed a bit, it seems that only the
MINOR version number should be incremented in the master branch until
the next major release.

This avoid confusion when writing upgrade scripts, it should work in any
case and it leaves more room from process improvement.

closes odoo/odoo#93123

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-06-09 08:11:19 +02:00
Christophe Monniez e5361e93be [IMP] core: bump master release to 16.1 alpha
closes odoo/odoo#92997

Related: odoo/upgrade#3571
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-06-08 10:06:42 +02:00
Christophe Monniez 80c2204e20 [FIX] tests: increase navigation timeout
When instrumenting the Chrome Browser and asking to navigate to a
location, it happens that the 10 seconds timeout is exceeded.

This happens particularly when executing qunit tests by navigating to
`/web/tests`. This route has an average loading time around 7 seconds
but when the runbot is loaded, it can exceed 10 seconds.

With this commit, the timeout is set to 15s. It would be better to split
the qunit tests by module in order to avoid the huge assets bundle
generation.

closes odoo/odoo#92699

X-original-commit: 6c0fa6b72bf5d15e8323b81cf930a01d4c0f3291
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-06-01 21:28:46 +02:00
Christophe Monniez 53d00c7ce5 [IMP] packaging: add a new install type for windows
In order to be able to use #86723 Odoo needs to be used as a local
proxy. With this commit, a new install type `Local Proxy Mode` is added
to the windows installer. When chosen, this install type does not
install the PostgreSQL server and it adds the `hw_l10n_eg_eta` as a
server wide module. It also generate and sets a proxy token.

While at it, the windows packaging is a bit improved:
* the VM now uses the virtio drivers
* the installer size and speed is improved

X-original-commit: 8586f78af36616d8014caf7ec9e44d8f6549d10d
Part-of: odoo/odoo#92195
2022-05-24 23:01:54 +02:00
Christophe Monniez bd3c681b99 [IMP] cli: add a command to generate a proxy token
This commit adds a `genproxytoken` command to generate and set an access
token for the proxy mode in the config file.

X-original-commit: 41a7224b46b3b163789257efd4583ef2d74479ba
Part-of: odoo/odoo#92195
2022-05-24 23:01:54 +02:00
Christophe Monniez dcb0eef401 [IMP] packaging: add a script to install packages
This is the long awaited small POSIX shell script that installs Debian
packages needed to run Odoo.

At the first time it was intended to be a small Perl script as Perl is
available everywhere. Finally it turned out that a POSIX shell script is
smaller, easier to read and could be run everywhere.

closes odoo/odoo#92038

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-05-23 14:02:45 +02:00
Christophe Monniez d2b7a601ba [FIX] test_crm_full: bump query count
This query count test fails deterministically on runbot when built with
Ubuntu Jammy. After some investigations, it appears that this query
count is very indeterministic and will be fixed in #91386.
Until that, the expected count is bumped.

Part-of: odoo/odoo#91927
2022-05-23 08:29:55 +02:00
Christophe Monniez 567721d136 [FIX] populate: force integer for randint
random.randrange needs integer values since python 3.10. As randint uses
randrange, we cast the seconds into integer.

Part-of: odoo/odoo#91927
2022-05-23 08:29:55 +02:00
Christophe Monniez e2ff2fd29b [FIX] link_tracker, pos_mercury: use unescape from html
As werkzeug.utils.unescape is deprecated in werkzeug 2.0 and the
markupsafe version of unescape just uses the built-in html.unescape [0],
we can use directly the same built-in method.

[0]  pallets/markupsafe@c35603a903

Part-of: odoo/odoo#91927
2022-05-23 08:29:54 +02:00
Christophe Monniez ba1724732c [FIX] core: ignore invalid escape sequence in 3.10
Since Python 3.10, the invalid escape sequence warning use quotes to
display the invalid sequence. Because of that, the filter does not catch
it anymore.

With this commit, they are caught in all supported versions.

Part-of: odoo/odoo#91927
2022-05-23 08:29:54 +02:00
Christophe Monniez 082a5a1a98 [FIX] report: replace deprecated LooseVersion method
With this commit, the LooseVersion function comes from distutils which
is deprecated [0] in Python 3.10 is replaced by parse_version.

[0]: https://peps.python.org/pep-0632/

Part-of: odoo/odoo#91927
2022-05-23 08:29:54 +02:00
Christophe Monniez 27a7d4822f [FIX] server: replace deprecated daemon getter/setter
Since Python 3.5 the isDaemon and setDaemon methods can be replaced by a
property. As it's now deprecated in Python 3.10, the Time has come.

[0] https://docs.python.org/3.5/library/threading.html#threading.Thread.setDaemon

Part-of: odoo/odoo#91927
2022-05-23 08:29:53 +02:00
Christophe Monniez f629cf5fee [FIX] safe_eval: add new py 3.10 GEN_START opcode
Part-of: odoo/odoo#91927
2022-05-23 08:29:53 +02:00
Christophe Monniez 22448d76da [FIX] requirements: adapt for ubuntu Jammy
Part-of: odoo/odoo#91927
2022-05-23 08:29:53 +02:00
Christophe Monniez 65c8814a2f [FIX] various: replace deprecated currentThread method
CurrentThread is now really deprecated in Python 3.10 ... Time to
change.

Part-of: odoo/odoo#91927
2022-05-23 08:29:52 +02:00
Christophe Monniez c16f35387f [FIX] tests: fix test retry mechanism for subtests
When a subtest fails, the failure or error is taken into account and even if
the subtest was silenced the test itself logs an ERROR with the count of
failures.

With this commit, at the first try, the subtest result is not taken into
account.

closes odoo/odoo#91974

X-original-commit: 96ca5bb6d7aeb54dfb8d5453edaf04b2ea903d41
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-05-22 09:03:51 +02:00
Christophe Monniez 00e210396a [FIX] web: let clickbot properly find modal dialogs
When clickbot opens a modal dialog, it should be detected and closed
properly. The `open` attribute was removed from the modal dialogs but
the clickbot test were successful by accident. Even though the modal was
not found, the script was still able to continue by clicking on other
elements.

By disabling the ability to click on other elements while a dialog is
open , this 590fa18cafe2c commit revealed the truth.

closes odoo/odoo#90393

X-original-commit: c5e2300cbb89519e002cf1784a8d6c6f68197742
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-05-03 14:38:34 +02:00
Christophe Monniez 53e687ab9c [FIX] mrp_subcontracting: properly import template helpers
Since bcf665a291, this helper has moved.

closes odoo/odoo#88559

X-original-commit: 2ac6357073d80fb07c7bd71cfd472d26ea1e5d83
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-04-12 16:50:04 +02:00
Christophe Monniez 082aa4d352 [IMP] core: bump master release to 15.4 alpha
closes odoo/odoo#88424

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-04-11 12:32:21 +02:00
Christophe Monniez 784049e97e [FIX] reqs: bump requests to match urllib3 requirements
The urrilb3 version was bumped to 1.26.5 in a87af91211bb but it appears
that requests 2.22.0 needs an urllib version < 1.26 [0].

With this commit, the requests version is bumped to 2.25.1 which needs urllib3 < 1.27 [1].

Debian Bullseye also provides requests 2.25.1 [2] while Ubuntu Focal
provides 2.22.0 [3].

[0] https://github.com/psf/requests/blob/aeda65bbe57ac5edbcc2d80db85d010befb7d419/setup.py#L47
[1] https://github.com/psf/requests/blob/c2b307dbefe21177af03f9feb37181a89a799fcc/setup.py#L47
[2] https://packages.debian.org/bullseye/python3-requests
[3] https://packages.ubuntu.com/focal/python3-requests

closes odoo/odoo#87517

X-original-commit: 0340de280e592517f73de8731683a5cd45988245
Signed-off-by: Olivier Dony <odo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-03-30 15:33:58 +02:00
Christophe Monniez 9c578fdff6 [FIX] packaging: fix rpm package and stop using bdist_rpm
The rpm package failed recently on a file name containing a space.
This issue is fixed by protecting file names with double quotes in the
installed files list.

Also, during this fix, it was discovered that the bdist_rpm is
deprecated in setuptools [0].

For that reason, the rpm is now generated from the package.py script.

[0] https://github.com/pypa/setuptools/pull/2780

closes odoo/odoo#84665

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-02-16 19:31:02 +00:00
Christophe Monniez f0715c419a [FIX] tests: wait for futures before clearing browser
When a test fails and asks for a screenshot, it seems that in some
conditions, the browser has already navigated to the blank page when
capturing the screenshot, resulting in a useless blank screenshot.

With this commit, all the futures are awaited to avoid this race
condition.

closes odoo/odoo#84566

X-original-commit: 37a7b81c28a7ad7c4f225e1463df96bbaf2d5c8f
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-02-14 19:25:13 +00:00
Christophe Monniez 4484fc1e7c [FIX] test_lint: properly gives optional argument
The es-check help specify that the `--module` optional argument as to be
given at the end of the cli. After an update to version `6.2.1` it led
to errors on runbot's where the Dockerfile was updated.  The error was
like if the `--module` cli argument was not given at all.  e.g.: `error:
SyntaxError: 'import' and 'export' may appear only with 'sourceType:
module'`

With this commit, the argument is given at the end of the cli as
expected.

closes odoo/odoo#84416

X-original-commit: dc74fd866d63003d987fc365a8137ff0e1c2d017
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-02-14 07:58:49 +00:00
Christophe MonniezandElisabeth Dickinson dd3ce8cf26 [FIX] survey: replace fonts with unclear license
In ae4435af, two fonts were added without a clear licensing.
With this commit, they are replaced with more recent and better fonts
with a clear OFL license.

closes odoo/odoo#84223

X-original-commit: bec81ca1870f0dcedcc781a7dbb907bdade78e69
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2022-02-09 06:30:07 +00:00
Christophe Monniez 8cc0a225a5 [IMP] core: bump master release to 15.3 alpha
closes odoo/odoo#83945

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-02-04 11:48:34 +00:00
Christophe Monniez e34430c822 [IMP] various: implement _neutralize method
As an overridable _neutralize model method was added in a previous
commit, the method is now implemented for various models.

closes odoo/odoo#67825

Related: odoo/enterprise#19042
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-02-01 09:54:08 +00:00
Christophe Monniez 4fc7b9e329 [IMP] iap, various: implement _neutralize method
An overridable model method was added in a previous commit in order to
neutralize a database.

This commit adds the implementation of this method on the `iap.account` model.
A _get_iap_config_paremeters method is also added on this model.
Each iap service must override this method to extend the list of
`ir.config_parameter` that need to be neutralized.

Part-of: odoo/odoo#67825
2022-02-01 09:54:08 +00:00
Christophe Monniez dc0baf4948 [IMP] payment*: implement _neutralize method
An overridable model method was added in a previous commit in order to
neutralize a database.

This commit introduce the implementation of this method for the payment
modules.

Also, a `_neutralize_fields` helper method is added on the
PaymentAcquirer model to simplify the neutralization of the various
payment modules.

Part-of: odoo/odoo#67825
2022-02-01 09:54:07 +00:00
Christophe Monniez 152310fe26 [IMP] core: add a neutralize CLI command
When debugging a database, it's sometimes desirable to neutralize it to
avoid undesired side effects like sending emails.

This commit adds a generic method `_neutralize` on models to neutralize
the current database. This method has to be overridden by modules models
that needs to be neutralized.

A new CLI command `neutralize`is now available that will permit to
neutralize a database from the command line before starting
investigations.

Pay attention that the neutralize operation cannot be reversed and should
only be used on a database copy.

Task id: 1818795

Part-of: odoo/odoo#67825
2022-02-01 09:54:07 +00:00
Christophe Monniez 8b295ad968 [FIX] tests: bump allowed assets generation time
As this test is always red, notably because of the qunit asset bundle, the
threshold is raised for some bundles based on runbot builds
observations.

closes odoo/odoo#82972

X-original-commit: ab8350b5432a6a6d671bcc76413815274f7daaca
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-01-18 13:40:47 +00:00
Christophe Monniez 858505517a [FIX] packaging: add explicit depends on multilingual fonts
A bug[0] was detected in the Odoo Docker image 15.0 when trying to print
invoices with arabic fonts (and probably other languages that need
specific font) . It appears that the necessary fonts are not available
in the container image.

Strangely, the issue did not exists in previous Odoo Docker images.

It appears that `fonts-dejavu-core` package was installed incidentally
by `wkhtmltox`[1] which is installed from the official website.
Note that the Debian version of `wkhtmltopdf`[2] does not provide this
dependency.

In the 15.0 Docker image, while the `wkhtmltox` is installed the same
way, the `fonts-dejavu-core` package was not installed because the
dependency of `fontconfig-config`[3] was already fulfilled by the
`python3-renderpm`[4] from Debian Bullseye.

Finally, to add more confusion, the Odoo package have an indirect
dependency on `fonts-dejavu-core` through the `python3-pydot`[5] package.
This explains why the issue was not found before.

In order to avoid all this spaghetti dependency hell, this commit adds
an explicit dependency on one of the multilingual fonts available in the
Debian packages.

[0] https://github.com/odoo/docker/issues/400
[1] https://github.com/wkhtmltopdf/wkhtmltopdf/releases/0.12.5/
[2] https://packages.debian.org/bullseye/wkhtmltopdf
[3] https://packages.debian.org/bullseye/fontconfig-config
[4] https://packages.debian.org/bullseye/python3-renderpm
[5] https://packages.debian.org/bullseye/python3-pydot

closes odoo/odoo#81742

X-original-commit: 3d6043a7356b90e5a69a5b535ec6c651d0860711
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-12-22 08:47:41 +00:00
Christophe Monniez 0aa8dbd295 [FIX] hr_holidays: fix freeze_time usage
When Freezegun is used with the `start` and `stop` method and the test
fails before the `stop`, the time stays frozen for all the other tests.

When it happens on runbot, a lot of tests brake with a lot of noise as
they are false negatives.

X-original-commit: 048796dc125b0d494f3c2fcd12625a84ee5cd91d
Part-of: odoo/odoo#81592
2021-12-17 13:40:05 +00:00
Christophe Monniez c435e307df [IMP] test_lint: add a lint test for manifest keys
closes odoo/odoo#79977

Related: odoo/enterprise#22846
Related: odoo/upgrade#3078
Signed-off-by: Raphael Collet <rco@odoo.com>
2021-12-14 12:39:54 +00:00
Christophe Monniez 9e41603743 [FIX] tests: fix race condition when spawning chrome
When Chrome is spawned, the `DevToolsActivePort`file is awaited to read
the port. Sometimes the file is read but is still empty, resulting in a
ValueError when trying to cast into integer. This happens when Chrome
did not have time yet to write into file.

With this commit, we expect the file to contain at least 5 bytes which
is enough to contain the max port number.

closes odoo/odoo#80791

X-original-commit: aab53fbb4e02461e0f23cf202d393e30a73fbc92
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-12-03 08:55:46 +00:00
Christophe Monniez c6600d1ea4 [IMP] core: bump master release version to 15.2
closes odoo/odoo#80708

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-12-02 08:31:59 +00:00
Christophe Monniez 01949f9419 [FIX] packaging: remove mako
Mako is not used anymore for a long time.

closes odoo/odoo#78781

X-original-commit: fb9f89afbc7a22e82309150617e8b5de5c995ff9
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-10-21 19:09:48 +00:00
Christophe Monniez f446e2fa19 [IMP] packaging: sort requirements
X-original-commit: 32f3e358853c24f4bb94d464bcf10629f8613380
Part-of: odoo/odoo#78781
2021-10-21 19:09:47 +00:00
Christophe Monniez 38deea6730 [IMP] requirements: adapt to latest focal versions
With the release of Debian Bullseye the time has come for the balancing
act by trying to update the requirements.

The constraints are the following:
    * Stick as close as possible to python3-* Debian packages versions
      of the current Debian stable.
    * Same but for the Ubuntu LTS version.
    * When one of the above package is patched by Debian or Ubuntu
      maintainers, set the upstream version that includes the patch if any.

Also, as support for python < 3.7 is dropped, some cleanup can be done.

The `reportlab / pillow` combo is a special case:
    * Pillow has to be updated to 8.1.2 as this version includes the
      security patches that were added to Ubuntu package 7.0.0 (Focal).
    * Reportlab crashes with 8.1.2 with version prior to 3.5.54 [0].
      The problem does not occur on Ubuntu Focal as both versions from
      the Ubuntu packaging are compatible.

So the reportlab 3.5.59 is chosen as it's the Debian Bullseye version
and to avoid multiple lines for a few minor versions.

[0] https://hg.reportlab.com/hg-public/reportlab/rev/0cf382dab63b

X-original-commit: 794677fb6a3391379200eb2144a6ed372e89c17a
Part-of: odoo/odoo#78781
2021-10-21 19:09:47 +00:00
Christophe Monniez fae2bd0c28 [FIX] packaging: verify repodata exists
The rpm packaging fails to generate a repository when the repodata
directory does not exists previously to the build.

The reason is that the package.py script removes the repodata before
rpm repo generation without verifying the the directory exists.

That kind of corner case happens when a new odoo version comes out.
With this commit, the script now verifies that the directory exists.

Also, while at it, a time stamp based on seconds is added to the default
build directory name to allow to build more than one time the same day
without removing the build directory. It's mainly a testing use case,
when the packaging script is tested, the build dir is usually kept for
debugging purposes.

closes odoo/odoo#78386

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-10-15 22:09:41 +00:00
Christophe Monniez e7231db74e [IMP] packaging: automate win installer displayed version
When a new Odoo version is released, the displayed version in the
Windows NSIS installer has to be manually updated.

With this commit, the displayed version is computed from the release.py
file.

Part-of: odoo/odoo#78386
2021-10-15 22:09:41 +00:00
Christophe Monniez c5a9089461 [IMP] packaging: update packaging docker files
Manual forward-port of odoo/odoo#77759

Cherry-pick of 4e57f41bb

closes odoo/odoo#77854

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-10-11 09:02:19 +00:00
Christophe Monniez 7e1e0f16e6 [FIX] packaging: fix python abi detection in rpm
Although the ABI detection was fixed in install, it was forgotten in
post install script.

closes odoo/odoo#78097

X-original-commit: 3a4e98b6fbf6dd3e88e94421496d5c15a517ff64
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-10-08 22:11:47 +00:00
Christophe Monniez f78b6d00af [FIX] packaging: add missing dependencies
A dependency on python pyopenssl package was added in #61853 and flew
under the radar. As this package is pure python, it should not cause any
arm.

Also, it seems that the gsfonts package is needed on Debian to print
things like barcode badges. Previously, the gsfonts package was a
dependency of python3-renderm package which is itself a dependency of
odoo. The gsfonts dependency was removed in the python3-renderpm Bullseye package.

With this commit the gsfonts dependency is set on the odoo Debian
package directly.

X-original-commit: 248762c80fbf3396d44ea9b55153dcd1d36d3490
Part-of: odoo/odoo#78097
2021-10-08 22:11:47 +00:00
Christophe Monniez c981c6ee7b [FIX] packaging: bump win installer version
Quick fix that need to be automated.

Closes #77981

closes odoo/odoo#77994

X-original-commit: 0a07ddbc750e561b63f6f12568baa66eba7c3ba2
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-10-07 11:50:44 +00:00