summaryrefslogtreecommitdiff
path: root/finance/odoo16/files
diff options
context:
space:
mode:
Diffstat (limited to 'finance/odoo16/files')
-rw-r--r--finance/odoo16/files/patch-odoo_____init____.py20
-rw-r--r--finance/odoo16/files/patch-odoo_addons_account__edi_models_account__edi__format.py14
-rw-r--r--finance/odoo16/files/patch-odoo_addons_account_models_ir__actions__report.py18
-rw-r--r--finance/odoo16/files/patch-odoo_addons_account_tests_test__ir__actions__report.py11
-rw-r--r--finance/odoo16/files/patch-odoo_addons_base_models_ir__actions__report.py23
-rw-r--r--finance/odoo16/files/patch-odoo_addons_snailmail_models_snailmail__letter.py11
-rw-r--r--finance/odoo16/files/patch-odoo_addons_website__event_controllers_main.py11
-rw-r--r--finance/odoo16/files/patch-odoo_addons_website__slides_models_slide__slide.py11
-rw-r--r--finance/odoo16/files/patch-odoo_addons_website_models_website.py11
-rw-r--r--finance/odoo16/files/patch-odoo_http.py22
-rw-r--r--finance/odoo16/files/patch-odoo_tools_pdf.py33
-rw-r--r--finance/odoo16/files/pkg-message.in2
12 files changed, 186 insertions, 1 deletions
diff --git a/finance/odoo16/files/patch-odoo_____init____.py b/finance/odoo16/files/patch-odoo_____init____.py
new file mode 100644
index 000000000000..d78098afc36d
--- /dev/null
+++ b/finance/odoo16/files/patch-odoo_____init____.py
@@ -0,0 +1,20 @@
+--- odoo/__init__.py.orig 2025-07-19 20:57:46 UTC
++++ odoo/__init__.py
+@@ -74,7 +74,7 @@ if hasattr(time, 'tzset'):
+ # because some pdf won't fit into allocated memory
+ # https://docs.python.org/3/library/zlib.html#zlib.decompressobj
+ # ----------------------------------------------------------
+-import PyPDF2
++import pypdf as PyPDF2
+
+ try:
+ import zlib
+@@ -83,7 +83,7 @@ try:
+ zobj = zlib.decompressobj()
+ return zobj.decompress(data)
+
+- import PyPDF2.filters # needed after PyPDF2 2.0.0 and before 2.11.0
++ import pypdf.filters # needed after PyPDF2 2.0.0 and before 2.11.0
+ PyPDF2.filters.decompress = _decompress
+ except ImportError:
+ pass # no fix required
diff --git a/finance/odoo16/files/patch-odoo_addons_account__edi_models_account__edi__format.py b/finance/odoo16/files/patch-odoo_addons_account__edi_models_account__edi__format.py
new file mode 100644
index 000000000000..86c3cf6ed1a3
--- /dev/null
+++ b/finance/odoo16/files/patch-odoo_addons_account__edi_models_account__edi__format.py
@@ -0,0 +1,14 @@
+--- odoo/addons/account_edi/models/account_edi_format.py.orig 2025-07-19 21:53:05 UTC
++++ odoo/addons/account_edi/models/account_edi_format.py
+@@ -7,9 +7,9 @@ try:
+ from odoo.tools import html_escape
+ from odoo.exceptions import RedirectWarning
+ try:
+- from PyPDF2.errors import PdfReadError
++ from pypdf.errors import PdfReadError
+ except ImportError:
+- from PyPDF2.utils import PdfReadError
++ from pypdf.utils import PdfReadError
+
+ from lxml import etree
+ from struct import error as StructError
diff --git a/finance/odoo16/files/patch-odoo_addons_account_models_ir__actions__report.py b/finance/odoo16/files/patch-odoo_addons_account_models_ir__actions__report.py
new file mode 100644
index 000000000000..5ac3faec6814
--- /dev/null
+++ b/finance/odoo16/files/patch-odoo_addons_account_models_ir__actions__report.py
@@ -0,0 +1,18 @@
+--- odoo/addons/account/models/ir_actions_report.py.orig 2025-07-19 21:08:49 UTC
++++ odoo/addons/account/models/ir_actions_report.py
+@@ -2,12 +2,12 @@ try:
+ from collections import OrderedDict
+ from zlib import error as zlib_error
+ try:
+- from PyPDF2.errors import PdfReadError
++ from pypdf.errors import PdfReadError
+ except ImportError:
+- from PyPDF2.utils import PdfReadError
++ from pypdf.utils import PdfReadError
+
+ try:
+- from PyPDF2.errors import DependencyError
++ from pypdf.errors import DependencyError
+ except ImportError:
+ DependencyError = NotImplementedError
+
diff --git a/finance/odoo16/files/patch-odoo_addons_account_tests_test__ir__actions__report.py b/finance/odoo16/files/patch-odoo_addons_account_tests_test__ir__actions__report.py
new file mode 100644
index 000000000000..574a5c261037
--- /dev/null
+++ b/finance/odoo16/files/patch-odoo_addons_account_tests_test__ir__actions__report.py
@@ -0,0 +1,11 @@
+--- odoo/addons/account/tests/test_ir_actions_report.py.orig 2025-07-19 21:11:20 UTC
++++ odoo/addons/account/tests/test_ir_actions_report.py
+@@ -2,7 +2,7 @@ import io
+ import base64
+ import io
+
+-from PyPDF2 import PdfFileReader, PdfFileWriter
++from pypdf import PdfReader as PdfFileReader, PdfWriter as PdfFileWriter
+
+ from odoo.addons.account.tests.common import AccountTestInvoicingCommon
+ from odoo.exceptions import RedirectWarning
diff --git a/finance/odoo16/files/patch-odoo_addons_base_models_ir__actions__report.py b/finance/odoo16/files/patch-odoo_addons_base_models_ir__actions__report.py
new file mode 100644
index 000000000000..d1014f32505f
--- /dev/null
+++ b/finance/odoo16/files/patch-odoo_addons_base_models_ir__actions__report.py
@@ -0,0 +1,23 @@
+--- odoo/addons/base/models/ir_actions_report.py.orig 2025-07-19 20:52:24 UTC
++++ odoo/addons/base/models/ir_actions_report.py
+@@ -24,7 +24,7 @@ from reportlab.pdfbase.pdfmetrics import getFont, Type
+ from contextlib import closing
+ from reportlab.graphics.barcode import createBarcodeDrawing
+ from reportlab.pdfbase.pdfmetrics import getFont, TypeFace
+-from PyPDF2 import PdfFileWriter, PdfFileReader
++from pypdf import PdfWriter as PdfFileWriter, PdfReader as PdfFileReader
+ from collections import OrderedDict
+ from collections.abc import Iterable
+ from PIL import Image, ImageFile
+@@ -32,9 +32,9 @@ try:
+ ImageFile.LOAD_TRUNCATED_IMAGES = True
+
+ try:
+- from PyPDF2.errors import PdfReadError
++ from pypdf.errors import PdfReadError
+ except ImportError:
+- from PyPDF2.utils import PdfReadError
++ from pypdf.utils import PdfReadError
+
+ _logger = logging.getLogger(__name__)
+
diff --git a/finance/odoo16/files/patch-odoo_addons_snailmail_models_snailmail__letter.py b/finance/odoo16/files/patch-odoo_addons_snailmail_models_snailmail__letter.py
new file mode 100644
index 000000000000..ca30b4581721
--- /dev/null
+++ b/finance/odoo16/files/patch-odoo_addons_snailmail_models_snailmail__letter.py
@@ -0,0 +1,11 @@
+--- odoo/addons/snailmail/models/snailmail_letter.py.orig 2025-07-19 20:56:13 UTC
++++ odoo/addons/snailmail/models/snailmail_letter.py
+@@ -4,7 +4,7 @@ import io
+ import base64
+ import io
+
+-from PyPDF2 import PdfFileReader, PdfFileWriter
++from pypdf import PdfReader as PdfFileReader, PdfWriter as PdfFileWriter
+ from reportlab.platypus import Frame, Paragraph, KeepInFrame
+ from reportlab.lib.units import mm
+ from reportlab.lib.pagesizes import A4
diff --git a/finance/odoo16/files/patch-odoo_addons_website__event_controllers_main.py b/finance/odoo16/files/patch-odoo_addons_website__event_controllers_main.py
new file mode 100644
index 000000000000..3179b8953162
--- /dev/null
+++ b/finance/odoo16/files/patch-odoo_addons_website__event_controllers_main.py
@@ -0,0 +1,11 @@
+--- odoo/addons/website_event/controllers/main.py.orig 2025-07-19 22:15:31 UTC
++++ odoo/addons/website_event/controllers/main.py
+@@ -10,7 +10,7 @@ from dateutil.relativedelta import relativedelta
+ from datetime import datetime, timedelta
+ from dateutil.parser import parse
+ from dateutil.relativedelta import relativedelta
+-from werkzeug.datastructures import OrderedMultiDict
++from werkzeug.datastructures import MultiDict as OrderedMultiDict
+ from werkzeug.exceptions import NotFound
+
+ from odoo import fields, http, _
diff --git a/finance/odoo16/files/patch-odoo_addons_website__slides_models_slide__slide.py b/finance/odoo16/files/patch-odoo_addons_website__slides_models_slide__slide.py
new file mode 100644
index 000000000000..9a04681fd99b
--- /dev/null
+++ b/finance/odoo16/files/patch-odoo_addons_website__slides_models_slide__slide.py
@@ -0,0 +1,11 @@
+--- odoo/addons/website_slides/models/slide_slide.py.orig 2025-07-19 21:31:58 UTC
++++ odoo/addons/website_slides/models/slide_slide.py
+@@ -7,7 +7,7 @@ import requests
+ import logging
+ import re
+ import requests
+-import PyPDF2
++import pypdf as PyPDF2
+
+ from dateutil.relativedelta import relativedelta
+ from markupsafe import Markup
diff --git a/finance/odoo16/files/patch-odoo_addons_website_models_website.py b/finance/odoo16/files/patch-odoo_addons_website_models_website.py
new file mode 100644
index 000000000000..f94b3a0becf1
--- /dev/null
+++ b/finance/odoo16/files/patch-odoo_addons_website_models_website.py
@@ -0,0 +1,11 @@
+--- odoo/addons/website/models/website.py.orig 2025-07-19 22:52:31 UTC
++++ odoo/addons/website/models/website.py
+@@ -17,7 +17,7 @@ from werkzeug import urls
+ from lxml import etree, html
+ from psycopg2 import sql
+ from werkzeug import urls
+-from werkzeug.datastructures import OrderedMultiDict
++from werkzeug.datastructures import MultiDict as OrderedMultiDict
+ from werkzeug.exceptions import NotFound
+ from markupsafe import Markup
+
diff --git a/finance/odoo16/files/patch-odoo_http.py b/finance/odoo16/files/patch-odoo_http.py
new file mode 100644
index 000000000000..9f163a8fbc06
--- /dev/null
+++ b/finance/odoo16/files/patch-odoo_http.py
@@ -0,0 +1,22 @@
+--- odoo/http.py.orig 2025-07-19 21:02:41 UTC
++++ odoo/http.py
+@@ -257,13 +257,12 @@ ROUTING_KEYS = {
+ 'alias', 'host', 'methods',
+ }
+
+-if parse_version(werkzeug.__version__) >= 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
+- # support the websocket routing key. In order to bypass this issue,
+- # let's add the websocket key only when appropriate.
+- ROUTING_KEYS.add('websocket')
++# 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
++# support the websocket routing key. In order to bypass this issue,
++# let's add the websocket key only when appropriate.
++ROUTING_KEYS.add('websocket')
+
+ # The default duration of a user session cookie. Inactive sessions are reaped
+ # server-side as well with a threshold that can be set via an optional
diff --git a/finance/odoo16/files/patch-odoo_tools_pdf.py b/finance/odoo16/files/patch-odoo_tools_pdf.py
new file mode 100644
index 000000000000..b65f21adcaad
--- /dev/null
+++ b/finance/odoo16/files/patch-odoo_tools_pdf.py
@@ -0,0 +1,33 @@
+--- odoo/tools/pdf.py.orig 2025-07-19 20:58:30 UTC
++++ odoo/tools/pdf.py
+@@ -12,28 +12,9 @@ from reportlab.pdfgen import canvas
+ from reportlab.lib.units import cm
+ from reportlab.lib.utils import ImageReader
+ from reportlab.pdfgen import canvas
++from pypdf import PdfWriter as PdfFileWriter, PdfReader as PdfFileReader
+
+-try:
+- # class were renamed in PyPDF2 > 2.0
+- # https://pypdf2.readthedocs.io/en/latest/user/migration-1-to-2.html#classes
+- from PyPDF2 import PdfReader
+- import PyPDF2
+- # monkey patch to discard unused arguments as the old arguments were not discarded in the transitional class
+- # https://pypdf2.readthedocs.io/en/2.0.0/_modules/PyPDF2/_reader.html#PdfReader
+- class PdfFileReader(PdfReader):
+- def __init__(self, *args, **kwargs):
+- if "strict" not in kwargs and len(args) < 2:
+- kwargs["strict"] = True # maintain the default
+- kwargs = {k:v for k, v in kwargs.items() if k in ('strict', 'stream')}
+- super().__init__(*args, **kwargs)
+-
+- PyPDF2.PdfFileReader = PdfFileReader
+- from PyPDF2 import PdfFileWriter, PdfFileReader
+- PdfFileWriter._addObject = PdfFileWriter._add_object
+-except ImportError:
+- from PyPDF2 import PdfFileWriter, PdfFileReader
+-
+-from PyPDF2.generic import DictionaryObject, NameObject, ArrayObject, DecodedStreamObject, NumberObject, createStringObject, ByteStringObject
++from pypdf.generic import DictionaryObject, NameObject, ArrayObject, DecodedStreamObject, NumberObject, create_string_object as createStringObject, ByteStringObject
+
+ try:
+ from fontTools.ttLib import TTFont
diff --git a/finance/odoo16/files/pkg-message.in b/finance/odoo16/files/pkg-message.in
index 5e270da93bc9..96922a3fd82e 100644
--- a/finance/odoo16/files/pkg-message.in
+++ b/finance/odoo16/files/pkg-message.in
@@ -17,7 +17,7 @@ Odoo 16 ERP was installed
3) Add odoo_enable="YES" to /etc/rc.conf. Also, can add the following lines:
odoo_database="postgresql_odoo_database_name" # This is odoodb by default
- odoo_datadir="/path/to/odoo/datadir" # This is /var/db/odoo by defualt
+ odoo_datadir="/path/to/odoo/datadir" # This is /var/lib/odoo by defualt
4) Odoo database host, user and password must be defined at %%ETCDIR%%/odoo.conf