Skip to content

Commit f5f2df7

Browse files
Merge remote-tracking branch 'origin/19.0' into 19.0-staging-sec-batch1
2 parents 6528c30 + 64e6b31 commit f5f2df7

40 files changed

Lines changed: 2391 additions & 866 deletions

docker/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ RUN --mount=type=cache,target=/root/.cache/uv,sharing=locked \
7777
-r /tmp/openspp-requirements.txt
7878

7979
# Download and install Odoo (cache the tarball to avoid re-downloading)
80+
# --no-deps: Odoo's runtime dependencies are already installed above from its
81+
# requirements.txt, which carries the correct per-Python-version pins. Odoo's
82+
# setup.py additionally declares an unpinned PyPDF2; resolving it installs
83+
# legacy PyPDF2 3.x, which odoo.tools.pdf then selects over pypdf and which
84+
# crashes multi-record PDF printing (OP#1168).
8085
RUN --mount=type=cache,target=/root/.cache/uv,sharing=locked \
8186
--mount=type=cache,target=/tmp/downloads,sharing=locked \
8287
set -eux; \
@@ -91,7 +96,7 @@ RUN --mount=type=cache,target=/root/.cache/uv,sharing=locked \
9196
mv /opt/odoo /opt/odoo-src; \
9297
mkdir -p /opt/odoo; \
9398
mv /opt/odoo-src /opt/odoo/odoo; \
94-
uv pip install -e /opt/odoo/odoo
99+
uv pip install --no-deps -e /opt/odoo/odoo
95100

96101
# Download OCA dependencies in builder (cache tarballs to avoid re-downloading)
97102
RUN --mount=type=cache,target=/tmp/downloads,sharing=locked \

spp_base_common/README.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,17 @@ Dependencies
120120
Changelog
121121
=========
122122

123+
19.0.2.0.2
124+
~~~~~~~~~~
125+
126+
- test: add a regression test guarding the PDF backend selected by
127+
``odoo.tools.pdf``. The Docker image accidentally shipped legacy
128+
PyPDF2 3.x next to pypdf; Odoo prefers PyPDF2 when importable, and its
129+
removed 1.x API (``numPages``/``getPage``) crashes multi-record PDF
130+
printing with a ``DeprecationError`` (OP#1168). The fix is in
131+
``docker/Dockerfile`` (``--no-deps`` on the Odoo editable install);
132+
this test fails on any image that regresses.
133+
123134
19.0.2.0.1
124135
~~~~~~~~~~
125136

spp_base_common/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"name": "OpenSPP Base (Common)",
77
"category": "OpenSPP/Core",
8-
"version": "19.0.2.0.1",
8+
"version": "19.0.2.0.2",
99
"sequence": 1,
1010
"author": "OpenSPP.org",
1111
"website": "https://github.com/OpenSPP/OpenSPP2",

spp_base_common/readme/HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 19.0.2.0.2
2+
3+
- test: add a regression test guarding the PDF backend selected by `odoo.tools.pdf`. The Docker image accidentally shipped legacy PyPDF2 3.x next to pypdf; Odoo prefers PyPDF2 when importable, and its removed 1.x API (`numPages`/`getPage`) crashes multi-record PDF printing with a `DeprecationError` (OP#1168). The fix is in `docker/Dockerfile` (`--no-deps` on the Odoo editable install); this test fails on any image that regresses.
4+
15
### 19.0.2.0.1
26

37
- fix(security): add `groups="base.group_system"` to the existing `<menuitem id="base.menu_management" />` override in `views/main_view.xml`. Out of the box the Apps top-level menu has no group restriction and is visible to every logged-in user, violating the OP#951 audit's `Apps: no` rows. The override here is the single authoritative declaration for this menu's attributes in the OpenSPP install (sequence, custom OpenSPP icon, and now group_ids); doing the gating anywhere upstream (e.g. a `post_init_hook` in `spp_security`) is unreliable because this `<menuitem>` reload re-writes the record without a `groups` attribute and resets `group_ids` to empty.

spp_base_common/static/description/index.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,18 @@ <h2><a class="toc-backref" href="#toc-entry-1">Changelog</a></h2>
495495
</div>
496496
</div>
497497
<div class="section" id="section-1">
498+
<h1>19.0.2.0.2</h1>
499+
<ul class="simple">
500+
<li>test: add a regression test guarding the PDF backend selected by
501+
<tt class="docutils literal">odoo.tools.pdf</tt>. The Docker image accidentally shipped legacy
502+
PyPDF2 3.x next to pypdf; Odoo prefers PyPDF2 when importable, and its
503+
removed 1.x API (<tt class="docutils literal">numPages</tt>/<tt class="docutils literal">getPage</tt>) crashes multi-record PDF
504+
printing with a <tt class="docutils literal">DeprecationError</tt> (OP#1168). The fix is in
505+
<tt class="docutils literal">docker/Dockerfile</tt> (<tt class="docutils literal"><span class="pre">--no-deps</span></tt> on the Odoo editable install);
506+
this test fails on any image that regresses.</li>
507+
</ul>
508+
</div>
509+
<div class="section" id="section-2">
498510
<h1>19.0.2.0.1</h1>
499511
<ul class="simple">
500512
<li>fix(security): add <tt class="docutils literal"><span class="pre">groups=&quot;base.group_system&quot;</span></tt> to the existing
@@ -510,7 +522,7 @@ <h1>19.0.2.0.1</h1>
510522
<tt class="docutils literal">group_ids</tt> to empty.</li>
511523
</ul>
512524
</div>
513-
<div class="section" id="section-2">
525+
<div class="section" id="section-3">
514526
<h1>19.0.2.0.0</h1>
515527
<ul class="simple">
516528
<li>Initial migration to OpenSPP2</li>

spp_base_common/tests/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
from . import test_ir_module_module
2+
from . import test_pdf_backend
23
from . import test_phone_number_validation
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import io
2+
3+
from odoo.tests import TransactionCase
4+
from odoo.tools.pdf import PdfFileReader, PdfFileWriter
5+
6+
7+
class TestPdfBackend(TransactionCase):
8+
"""Guard the PDF backend selected by odoo.tools.pdf.
9+
10+
Printing a report for multiple records splits the combined document in
11+
ir.actions.report._render_qweb_pdf_prepare_streams using the legacy
12+
PyPDF2 1.x API (numPages, getPage, addPage). If the image ships legacy
13+
PyPDF2 3.x, odoo.tools.pdf selects it over pypdf and that API raises
14+
DeprecationError, so multi-record printing crashes while single-record
15+
printing still works (OP#1168).
16+
"""
17+
18+
def _make_two_page_pdf(self):
19+
from reportlab.pdfgen import canvas
20+
21+
buffer = io.BytesIO()
22+
pdf_canvas = canvas.Canvas(buffer)
23+
pdf_canvas.drawString(100, 750, "page 1")
24+
pdf_canvas.showPage()
25+
pdf_canvas.drawString(100, 750, "page 2")
26+
pdf_canvas.showPage()
27+
pdf_canvas.save()
28+
buffer.seek(0)
29+
return buffer
30+
31+
def test_01_multi_record_split_legacy_api(self):
32+
# Mirrors the multi-record path of _render_qweb_pdf_prepare_streams
33+
reader = PdfFileReader(self._make_two_page_pdf())
34+
self.assertEqual(reader.numPages, 2)
35+
for page_index in range(reader.numPages):
36+
writer = PdfFileWriter()
37+
writer.addPage(reader.getPage(page_index))
38+
stream = io.BytesIO()
39+
writer.write(stream)
40+
self.assertTrue(stream.getvalue().startswith(b"%PDF"))

spp_drims/README.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,25 @@ Dependencies
179179
Changelog
180180
=========
181181

182+
19.0.3.0.0
183+
~~~~~~~~~~
184+
185+
- feat(drims): allocate stock per source warehouse. The Allocate Stock
186+
wizard now auto-splits each requested line across the DRIMS warehouses
187+
that hold stock (e.g. 70 → 50 @ WH1 + 20 @ WH2) with editable rows;
188+
the split is captured on a new per-warehouse allocation record, shown
189+
on the request's Allocations tab and summarised in a "Source
190+
Warehouse(s)" column on the Requests list; dispatch creates one
191+
picking per source warehouse. The single "Source Warehouse" field on
192+
the request has been removed — the warehouse(s) are chosen in the
193+
wizard. The allocation wizard distinguishes no-stock, stock-shortfall
194+
and deliberate partial-allocation cases with clear messages, and the
195+
request line's Fulfillment % tracks allocated ÷ requested so the bar
196+
reflects allocation progress (#1079)
197+
- feat(drims): Requests review UI/UX overhaul — post-approval
198+
fulfillment lanes, allocation shortfall indicators, and a
199+
destination-type selector (#1075)
200+
182201
19.0.2.0.0
183202
~~~~~~~~~~
184203

spp_drims/__manifest__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"and distribution tracking. Links to hazard incidents with multi-tier "
66
"approval workflows and warehouse operations.",
77
"category": "OpenSPP/Inventory",
8-
"version": "19.0.2.0.0",
8+
"version": "19.0.3.0.0",
99
"sequence": 1,
1010
"author": "OpenSPP.org",
1111
"website": "https://github.com/OpenSPP/OpenSPP2",
@@ -53,6 +53,7 @@
5353
# Wizards (before views, as views may reference wizard actions)
5454
"wizard/bulk_approve_wizard.xml",
5555
"wizard/request_reject_wizard_views.xml",
56+
"wizard/request_revision_wizard_views.xml",
5657
"wizard/report_4w_wizard_views.xml",
5758
"wizard/stock_adjustment_wizard_views.xml",
5859
"wizard/inter_warehouse_transfer_wizard_views.xml",
@@ -88,6 +89,7 @@
8889
"spp_drims/static/src/js/qty_split_progress_field.js",
8990
"spp_drims/static/src/xml/qty_split_progress_field.xml",
9091
"spp_drims/static/src/css/inspection_wizard.css",
92+
"spp_drims/static/src/css/request_form.css",
9193
],
9294
},
9395
"application": True,

spp_drims/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from . import personnel
88
from . import request
99
from . import request_line
10+
from . import request_allocation
1011
from . import request_template
1112
from . import returns
1213
from . import stock_picking

0 commit comments

Comments
 (0)