about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSirio Balmelli <sirio@b-ad.ch>2024-06-19 13:35:20 +0000
committerSirio Balmelli <sirio@b-ad.ch>2024-06-19 13:35:20 +0000
commita972071a311abb6576560c32fb586f852a7aaffd (patch)
treece3018d8b60bda28fc2cf52f5364e6bedf9c5897
parentb906b68826db45fa67630ea6db53692d769d449c (diff)
odoo: 16.0.20231024 -> 17.0.20240507
Preserve 'odoo16' on the same pattern as existing 'odoo15'

Signed-off-by: Sirio Balmelli <sirio@b-ad.ch>
-rw-r--r--nixos/doc/manual/release-notes/rl-2405.section.md1
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--pkgs/applications/finance/odoo/default.nix39
-rw-r--r--pkgs/applications/finance/odoo/odoo16.nix116
-rw-r--r--pkgs/top-level/all-packages.nix1
5 files changed, 135 insertions, 23 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md
index 165e3e13a78ef..8fa59863bf782 100644
--- a/nixos/doc/manual/release-notes/rl-2405.section.md
+++ b/nixos/doc/manual/release-notes/rl-2405.section.md
@@ -822,3 +822,4 @@ Module System:
 ### Internal {#sec-release-24.05-lib-internal}
 - `lib` now has [Readme for contributing](https://github.com/NixOS/nixpkgs/tree/master/lib#readme).
 - Some function's documentation is now written using the [accepted doc comment syntax](https://github.com/NixOS/rfcs/pull/145).
+- `odoo` has been updated from `16.0.20231024` to `17.0.20240507`.
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 6b5ee429f9a22..8d5b865891e4a 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -414,6 +414,7 @@ in {
   pyload = handleTest ./pyload.nix {};
   oci-containers = handleTestOn ["aarch64-linux" "x86_64-linux"] ./oci-containers.nix {};
   odoo = handleTest ./odoo.nix {};
+  odoo16 = handleTest ./odoo.nix { package = pkgs.odoo16; };
   odoo15 = handleTest ./odoo.nix { package = pkgs.odoo15; };
   # 9pnet_virtio used to mount /nix partition doesn't support
   # hibernation. This test happens to work on x86_64-linux but
diff --git a/pkgs/applications/finance/odoo/default.nix b/pkgs/applications/finance/odoo/default.nix
index c30e96f1eed87..df61e1c02f13b 100644
--- a/pkgs/applications/finance/odoo/default.nix
+++ b/pkgs/applications/finance/odoo/default.nix
@@ -1,5 +1,6 @@
 { stdenv
 , lib
+, fetchgit
 , fetchzip
 , python310
 , rtlcss
@@ -9,40 +10,31 @@
 
 let
   python = python310.override {
-    packageOverrides = self: super: {
-      flask = super.flask.overridePythonAttrs (old: rec {
-        version = "2.3.3";
-        src = old.src.override {
-          inherit version;
-          hash = "sha256-CcNHqSqn/0qOfzIGeV8w2CZlS684uHPQdEzVccpgnvw=";
+    packageOverrides = final: prev: {
+      # requirements.txt fixes docutils at 0.17; the default 0.21.1 tested throws exceptions
+      docutils-0_17 = prev.docutils.overridePythonAttrs (old: rec {
+        version = "0.17";
+        src = fetchgit {
+          url = "git://repo.or.cz/docutils.git";
+          rev = "docutils-${version}";
+          hash = "sha256-O/9q/Dg1DBIxKdNBOhDV16yy5ez0QANJYMjeovDoWX8=";
         };
-      });
-      werkzeug = super.werkzeug.overridePythonAttrs (old: rec {
-        version = "2.3.7";
-        src = old.src.override {
-          inherit version;
-          hash = "sha256-K4wORHtLnbzIXdl7butNy69si2w74L1lTiVVPgohV9g=";
-        };
-        disabledTests = old.disabledTests ++ [
-          "test_response_body"
-        ];
+        buildInputs = with prev; [setuptools];
       });
     };
   };
-
-  odoo_version = "16.0";
-  odoo_release = "20231024";
+  odoo_version = "17.0";
+  odoo_release = "20240507";
 in python.pkgs.buildPythonApplication rec {
   pname = "odoo";
   version = "${odoo_version}.${odoo_release}";
 
   format = "setuptools";
 
-  # latest release is at https://github.com/odoo/docker/blob/master/16.0/Dockerfile
   src = fetchzip {
     url = "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.zip";
     name = "${pname}-${version}";
-    hash = "sha256-Ux8RfA7kWLKissBBY5wrfL+aKKw++5BxjP3Vw0JAOsk="; # odoo
+    hash = "sha256-WdJBs1YgJhHmD+ip6UU2pwXrcZCsbjgOGjrZTRFQBFw="; # odoo
   };
 
   # needs some investigation
@@ -57,7 +49,7 @@ in python.pkgs.buildPythonApplication rec {
     chardet
     cryptography
     decorator
-    docutils
+    docutils-0_17  # sphinx has a docutils requirement >= 18
     ebaysdk
     freezegun
     gevent
@@ -86,6 +78,7 @@ in python.pkgs.buildPythonApplication rec {
     qrcode
     reportlab
     requests
+    rjsmin
     urllib3
     vobject
     werkzeug
@@ -112,6 +105,6 @@ in python.pkgs.buildPythonApplication rec {
     description = "Open Source ERP and CRM";
     homepage = "https://www.odoo.com/";
     license = licenses.lgpl3Only;
-    maintainers = with maintainers; [ mkg20001 ];
+    maintainers = with maintainers; [ mkg20001 siriobalmelli ];
   };
 }
diff --git a/pkgs/applications/finance/odoo/odoo16.nix b/pkgs/applications/finance/odoo/odoo16.nix
new file mode 100644
index 0000000000000..6e68228d73479
--- /dev/null
+++ b/pkgs/applications/finance/odoo/odoo16.nix
@@ -0,0 +1,116 @@
+{ stdenv
+, lib
+, fetchzip
+, python310
+, rtlcss
+, wkhtmltopdf
+, nixosTests
+}:
+
+let
+  python = python310.override {
+    packageOverrides = self: super: {
+      flask = super.flask.overridePythonAttrs (old: rec {
+        version = "2.3.3";
+        src = old.src.override {
+          inherit version;
+          hash = "sha256-CcNHqSqn/0qOfzIGeV8w2CZlS684uHPQdEzVccpgnvw=";
+        };
+      });
+      werkzeug = super.werkzeug.overridePythonAttrs (old: rec {
+        version = "2.3.7";
+        src = old.src.override {
+          inherit version;
+          hash = "sha256-K4wORHtLnbzIXdl7butNy69si2w74L1lTiVVPgohV9g=";
+        };
+        disabledTests = old.disabledTests ++ [
+          "test_response_body"
+        ];
+      });
+    };
+  };
+
+  odoo_version = "16.0";
+  odoo_release = "20231024";
+in python.pkgs.buildPythonApplication rec {
+  pname = "odoo";
+  version = "${odoo_version}.${odoo_release}";
+
+  format = "setuptools";
+
+  # latest release is at https://github.com/odoo/docker/blob/master/16.0/Dockerfile
+  src = fetchzip {
+    url = "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.zip";
+    name = "${pname}-${version}";
+    hash = "sha256-Ux8RfA7kWLKissBBY5wrfL+aKKw++5BxjP3Vw0JAOsk="; # odoo
+  };
+
+  # needs some investigation
+  doCheck = false;
+
+  makeWrapperArgs = [
+    "--prefix" "PATH" ":" "${lib.makeBinPath [ wkhtmltopdf rtlcss ]}"
+  ];
+
+  propagatedBuildInputs = with python.pkgs; [
+    babel
+    chardet
+    cryptography
+    decorator
+    docutils
+    ebaysdk
+    freezegun
+    gevent
+    greenlet
+    idna
+    jinja2
+    libsass
+    lxml
+    markupsafe
+    num2words
+    ofxparse
+    passlib
+    pillow
+    polib
+    psutil
+    psycopg2
+    pydot
+    pyopenssl
+    pypdf2
+    pyserial
+    python-dateutil
+    python-ldap
+    python-stdnum
+    pytz
+    pyusb
+    qrcode
+    reportlab
+    requests
+    urllib3
+    vobject
+    werkzeug
+    xlrd
+    xlsxwriter
+    xlwt
+    zeep
+
+    setuptools
+    mock
+  ];
+
+  # takes 5+ minutes and there are not files to strip
+  dontStrip = true;
+
+  passthru = {
+    tests = {
+      inherit (nixosTests) odoo;
+    };
+  };
+
+  meta = with lib; {
+    description = "Open Source ERP and CRM";
+    homepage = "https://www.odoo.com/";
+    license = licenses.lgpl3Only;
+    maintainers = with maintainers; [ mkg20001 ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index e2fac29ce7274..d2e5a4aed5bac 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -5969,6 +5969,7 @@ with pkgs;
   };
 
   odoo = callPackage ../applications/finance/odoo { };
+  odoo16 = callPackage ../applications/finance/odoo/odoo16.nix { };
   odoo15 = callPackage ../applications/finance/odoo/odoo15.nix { };
 
   odafileconverter = libsForQt5.callPackage ../applications/graphics/odafileconverter { };