mirror of
https://github.com/bringout/oca-ocb-accounting.git
synced 2026-04-18 05:41:59 +02:00
- Added explicit page copying after cloneReaderDocumentRoot() calls
- Renamed PATCH_PDFWRITER.md to PATCH_PYPDF2_PDFWRITER.md
- Prevents 327-byte empty PDFs in PyPDF2 3.x
🤖 assisted by claude
2.8 KiB
2.8 KiB
PyPDF2 Compatibility Patch - Account (OCB)
Overview
This package benefits from the PyPDF2 compatibility fixes implemented in the oca-ocb-base package. The account module contains test files that use PyPDF2 classes, which are automatically compatible through the main compatibility layer.
Problem
In PyPDF2 3.0.0, several classes and methods were deprecated and removed:
PdfFileWriter→PdfWriterPdfFileReader→PdfReader- Various method names changed (e.g.,
addPage()→add_page())
Affected Functionality
The account module has:
- Test files that directly use
PdfFileWriterandPdfFileReader - PDF processing in test scenarios
- Account report PDF generation testing
Solution
This package requires NO direct patches because:
- Test files use PyPDF2 classes that are handled by the global compatibility layer
- Main account functionality uses
OdooPdfFileWriter/OdooPdfFileReaderfrom oca-ocb-base - The compatibility layer in
oca-ocb-baseautomatically handles all PyPDF2 version differences
Files Using PyPDF2
account/tests/test_ir_actions_report.py
- Direct PyPDF2 imports:
from PyPDF2 import PdfFileReader, PdfFileWriter - Test PDF creation and manipulation
- Automatically compatible through oca-ocb-base patches
Implementation Details
No code changes needed in this package. Compatibility is achieved through:
- Global compatibility: PyPDF2 classes are monkey-patched by oca-ocb-base
- Automatic inheritance: All PyPDF2 usage automatically uses compatibility wrappers
- Test compatibility: Test files work seamlessly with both PyPDF2 versions
Testing
The compatibility has been verified with:
- PyPDF2 3.0.0+ (new API)
- PyPDF2 2.x (old API)
- Account report generation
- PDF test scenarios
- Account-specific PDF workflows
Branch Information
- Branch:
pdfwrite - Based on: Current master branch
- Type: Dependency compatibility (no direct patches)
- Impact: Automatic compatibility through oca-ocb-base dependency
Dependencies
CRITICAL: This package requires:
oca-ocb-basepackage onpdfwritebranch- The main PyPDF2 compatibility layer must be active
Author
- Developer: Ernad Husremović (hernad@bring.out.ba)
- Company: bring.out.doo Sarajevo
- Date: 2025-09-02
Related Issues
This documentation addresses PyPDF2 compatibility for:
- Account report generation
- PDF testing scenarios
- Invoice PDF processing
Installation
- Ensure
oca-ocb-baseis using thepdfwritebranch - Use this package's
pdfwritebranch (for documentation compliance) - No additional installation steps required
Future Considerations
- Monitor oca-ocb-base compatibility updates
- Test account workflows with future PyPDF2 versions
- Consider updating test files to use newer PyPDF2 patterns