diff --git a/pkgs/by-name/od/odoo16/fix-test.patch b/pkgs/by-name/od/odoo16/fix-test.patch new file mode 100644 index 000000000000..232590c87c30 --- /dev/null +++ b/pkgs/by-name/od/odoo16/fix-test.patch @@ -0,0 +1,22 @@ +diff --git a/odoo/http.py b/odoo/http.py +index f26dd52db235c..9689fc894b2b1 100644 +--- a/odoo/http.py ++++ b/odoo/http.py +@@ -117,6 +117,7 @@ + import glob + import hashlib + import hmac ++import importlib.metadata + import inspect + import json + import logging +@@ -256,7 +257,7 @@ def get_default_session(): + 'alias', 'host', 'methods', + } + +-if parse_version(werkzeug.__version__) >= parse_version('2.0.2'): ++if parse_version(importlib.metadata.version('werkzeug')) >= parse_version('2.0.2'): + # Werkzeug 2.0.2 adds the websocket option. If a websocket request + # (ws/wss) is trying to access an HTTP route, a WebsocketMismatch + # exception is raised. On the other hand, Werkzeug 0.16 does not + diff --git a/pkgs/by-name/od/odoo16/package.nix b/pkgs/by-name/od/odoo16/package.nix index 73791dbcfcf1..e8d4f1cad4d0 100644 --- a/pkgs/by-name/od/odoo16/package.nix +++ b/pkgs/by-name/od/odoo16/package.nix @@ -1,7 +1,7 @@ { lib, fetchzip, - python310, + python311, rtlcss, wkhtmltopdf, nixosTests, @@ -9,8 +9,8 @@ let odoo_version = "16.0"; - odoo_release = "20241010"; - python = python310.override { + odoo_release = "20250506"; + python = python311.override { self = python; }; in @@ -24,9 +24,11 @@ python.pkgs.buildPythonApplication rec { src = fetchzip { url = "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.zip"; name = "odoo-${version}"; - hash = "sha256-ICe5UOy+Ga81fE66SnIhRz3+JEEbGfoz7ag53mkG4UM="; # odoo + hash = "sha256-dBqRZ3cf4/udP9hm+u9zhuUCkH176uG2NPAy5sujyNc="; # odoo }; + patches = [ ./fix-test.patch ]; + makeWrapperArgs = [ "--prefix" "PATH" @@ -90,7 +92,7 @@ python.pkgs.buildPythonApplication rec { passthru = { updateScript = ./update.sh; tests = { - inherit (nixosTests) odoo; + inherit (nixosTests) odoo16; }; }; diff --git a/pkgs/by-name/od/odoo17/package.nix b/pkgs/by-name/od/odoo17/package.nix index 698afb37d103..3e4a9634e636 100644 --- a/pkgs/by-name/od/odoo17/package.nix +++ b/pkgs/by-name/od/odoo17/package.nix @@ -2,7 +2,8 @@ lib, fetchgit, fetchzip, - python310, + fetchpatch2, + python311, rtlcss, wkhtmltopdf, nixosTests, @@ -10,8 +11,8 @@ let odoo_version = "17.0"; - odoo_release = "20241010"; - python = python310.override { + odoo_release = "20250506"; + python = python311.override { self = python; packageOverrides = final: prev: { # requirements.txt fixes docutils at 0.17; the default 0.21.1 tested throws exceptions @@ -37,8 +38,14 @@ python.pkgs.buildPythonApplication rec { src = fetchzip { url = "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.zip"; name = "odoo-${version}"; - hash = "sha256-s4Fvzjwl2oM0V9G1WQdSoqo7kE7b8tJdluk9f7A06e8="; # odoo + hash = "sha256-V15Oe3AOBJ1agt5WmpFZnC7EkyoKyxTH8Iqdf2/9aec="; # odoo }; + patches = [ + (fetchpatch2 { + url = "https://github.com/odoo/odoo/commit/ade3200e8138a9c28eb9b294a4efd2753a8e5591.patch?full_index=1"; + hash = "sha256-EFKjrR38eg9bxlNmRNoLSXem+MjQKqPcR3/mSgs0cDs="; + }) + ]; makeWrapperArgs = [ "--prefix" @@ -105,7 +112,7 @@ python.pkgs.buildPythonApplication rec { passthru = { updateScript = ./update.sh; tests = { - inherit (nixosTests) odoo; + inherit (nixosTests) odoo17; }; };