This commit is contained in:
Ernad Husremovic 2025-08-29 17:40:39 +02:00
parent 12c29a983b
commit 95fcc8bd63
189 changed files with 170858 additions and 0 deletions

View file

@ -0,0 +1,32 @@
# Architecture
```mermaid
flowchart TD
U[Users] -->|HTTP| V[Views and QWeb Templates]
V --> C[Controllers]
V --> W[Wizards Transient Models]
C --> M[Models and ORM]
W --> M
M --> R[Reports]
DX[Data XML] --> M
S[Security ACLs and Groups] -. enforces .-> M
subgraph Payment Module - payment
direction LR
M:::layer
W:::layer
C:::layer
V:::layer
R:::layer
S:::layer
DX:::layer
end
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
```
Notes
- Views include tree/form/kanban templates and report templates.
- Controllers provide website/portal routes when present.
- Wizards are UI flows implemented with `models.TransientModel`.
- Data XML loads data/demo records; Security defines groups and access.

View file

@ -0,0 +1,3 @@
# Configuration
Refer to Odoo settings for payment. Configure related models, access rights, and options as needed.

View file

@ -0,0 +1,17 @@
# Controllers
HTTP routes provided by this module.
```mermaid
sequenceDiagram
participant U as User/Client
participant C as Module Controllers
participant O as ORM/Views
U->>C: HTTP GET/POST (routes)
C->>O: ORM operations, render templates
O-->>U: HTML/JSON/PDF
```
Notes
- See files in controllers/ for route definitions.

View file

@ -0,0 +1,5 @@
# Dependencies
This addon depends on:
- [portal](../../odoo-bringout-oca-ocb-portal)

View file

@ -0,0 +1,4 @@
# FAQ
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
- Q: How to enable? A: Start server with --addon payment or install in UI.

View file

@ -0,0 +1,7 @@
# Install
```bash
pip install odoo-bringout-oca-ocb-payment"
# or
uv pip install odoo-bringout-oca-ocb-payment"
```

View file

@ -0,0 +1,18 @@
# Models
Detected core models and extensions in payment.
```mermaid
classDiagram
class payment_icon
class payment_provider
class payment_token
class payment_transaction
class ir_http
class res_company
class res_partner
```
Notes
- Classes show model technical names; fields omitted for brevity.
- Items listed under _inherit are extensions of existing models.

View file

@ -0,0 +1,6 @@
# Overview
Packaged Odoo addon: payment. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon payment
- License: LGPL-3

View file

@ -0,0 +1,156 @@
# Patch: Remove Payment Provider Dependencies
## Summary
This patch removes external payment provider dependencies from the payment module to resolve installation issues with the invoicing/accounting module.
**Date:** 2025-08-24
**Issue:** FileNotFoundError during account module installation due to missing payment provider modules
**Solution:** Remove payment provider data records that reference non-existent modules
## Problem Description
When attempting to install the invoicing module from `packages/odoo-bringout-oca-ocb-account/`, the installation failed with the following error:
```
FileNotFoundError: File not found: payment_adyen/static/description/icon.png
Traceback (most recent call last):
File "/home/odoo/packages/odoo-bringout-oca-ocb-base/odoo/tools/convert.py", line 706, in _tag_root
f(rec)
File "/home/odoo/packages/odoo-bringout-oca-ocb-base/odoo/tools/convert.py", line 581, in _tag_record
f_val = _eval_xml(self, field, env)
File "/home/odoo/packages/odoo-bringout-oca-ocb-base/odoo/tools/convert.py", line 149, in _eval_xml
with file_open(node.get('file'), 'rb', env=env) as f:
File "/home/odoo/packages/odoo-bringout-oca-ocb-base/odoo/tools/misc.py", line 212, in file_open
path = file_path(name, filter_ext=filter_ext, env=env)
File "/home/odoo/packages/odoo-bringout-oca-ocb-base/odoo/tools/misc.py", line 191, in file_path
raise FileNotFoundError("File not found: " + file_path)
```
## Root Cause Analysis
The error occurred because the `../odoo-bringout-oca-ocb-payment/payment/data/payment_provider_data.xml` file contained references to external payment provider modules that were not present in the packages directory:
- `payment_adyen`
- `payment_aps`
- `payment_asiapay`
- `payment_authorize`
- `payment_buckaroo`
- `payment_demo`
- `payment_flutterwave`
- `payment_mercado_pago`
- `payment_mollie`
- `payment_paypal`
- `payment_razorpay`
- `payment_sips`
- `payment_stripe`
- `payment_custom`
Each of these records attempted to load icon files from their respective module directories, which did not exist, causing the invoicing module installation to fail.
## Investigation Process
1. **Package Structure Analysis**: Examined the `/packages` directory to identify available modules
2. **Dependency Mapping**: Confirmed that the referenced payment provider modules were not present
3. **Error Trace Analysis**: Located the problematic XML file and specific line causing the failure
4. **Impact Assessment**: Determined that removing these providers would not affect core payment functionality
## Solution Implementation
### Files Modified
**File:** `packages/odoo-bringout-oca-ocb-payment/payment/data/payment_provider_data.xml`
**Changes Made:**
- Removed all payment provider records that referenced non-existent modules
- Simplified the file to contain only essential structure
- Added explanatory comment about the removal
### Before (252 lines)
```xml
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">
<record id="payment_provider_adyen" model="payment.provider">
<field name="name">Adyen</field>
<field name="display_as">Credit Card (powered by Adyen)</field>
<field name="image_128" type="base64" file="payment_adyen/static/description/icon.png"/>
<field name="module_id" ref="base.module_payment_adyen"/>
<!-- ... more providers ... -->
</record>
<!-- ... 15+ payment provider records ... -->
</odoo>
```
### After (6 lines)
```xml
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">
<!-- Simplified payment provider data - removed external payment modules dependencies -->
</odoo>
```
## Impact Assessment
### Positive Impacts
- ✅ Resolves installation failures for accounting/invoicing modules
- ✅ Eliminates dependency on non-existent payment provider modules
- ✅ Simplifies the payment module structure
- ✅ Enables successful Docker container operations
### Removed Functionality
- ❌ Pre-configured payment provider records for external services
- ❌ Default payment method icons and configurations
- ❌ Out-of-the-box integration with third-party payment processors
### Mitigation
Payment providers can still be configured manually through the Odoo interface if/when the actual payment provider modules are installed. The core payment infrastructure remains intact.
## Testing Results
After applying the patch:
- ✅ Docker services start successfully
- ✅ No more FileNotFoundError exceptions
- ✅ Invoicing module installation proceeds without errors
- ✅ Core payment functionality remains available
## Recommendations
### Short Term
1. **Monitor Installation**: Verify that other modules dependent on payment functionality install correctly
2. **Document Limitations**: Ensure users understand that external payment providers need manual configuration
3. **Test Core Flows**: Validate that basic payment workflows still function
### Long Term
1. **Conditional Loading**: Consider implementing conditional loading of payment providers based on module availability
2. **Module Dependencies**: Review and update module dependency declarations
3. **Provider Modules**: Add actual payment provider modules if needed for production use
## Related Files
- `packages/odoo-bringout-oca-ocb-payment/payment/data/payment_provider_data.xml` - Modified file
- `packages/odoo-bringout-oca-ocb-account/account/__manifest__.py` - Dependent module
- `docker/docker-compose.yml` - Docker configuration
- `scripts/build_docker.sh` - Build script
## Docker Environment
This patch was applied in the context of a Dockerized Odoo environment:
- **Container**: `odoo-pythonic-app`
- **Database**: PostgreSQL container `odoo-postgres`
- **Port**: 8069
- **Working Directory**: `/home/odoo`
## Reverting the Patch
To revert this patch, restore the original content of `payment_provider_data.xml` from version control or reinstall the payment module from upstream. Note that doing so will reintroduce the installation errors unless the referenced payment provider modules are also installed.
## Author
Applied by: Claude Code Assistant
Date: 2025-08-24
Context: Docker environment setup and invoicing module installation troubleshooting

View file

@ -0,0 +1,3 @@
# Reports
This module does not define custom reports.

View file

@ -0,0 +1,41 @@
# Security
Access control and security definitions in payment.
## Access Control Lists (ACLs)
Model access permissions defined in:
- **[ir.model.access.csv](../payment/security/ir.model.access.csv)**
- 12 model access rules
## Record Rules
Row-level security rules defined in:
## Security Groups & Configuration
Security groups and permissions defined in:
- **[payment_security.xml](../payment/security/payment_security.xml)**
```mermaid
graph TB
subgraph "Security Layers"
A[Users] --> B[Groups]
B --> C[Access Control Lists]
C --> D[Models]
B --> E[Record Rules]
E --> F[Individual Records]
end
```
Security files overview:
- **[ir.model.access.csv](../payment/security/ir.model.access.csv)**
- Model access permissions (CRUD rights)
- **[payment_security.xml](../payment/security/payment_security.xml)**
- Security groups, categories, and XML-based rules
Notes
- Access Control Lists define which groups can access which models
- Record Rules provide row-level security (filter records by user/group)
- Security groups organize users and define permission sets
- All security is enforced at the ORM level by Odoo

View file

@ -0,0 +1,5 @@
# Troubleshooting
- Ensure Python and Odoo environment matches repo guidance.
- Check database connectivity and logs if startup fails.
- Validate that dependent addons listed in DEPENDENCIES.md are installed.

View file

@ -0,0 +1,7 @@
# Usage
Start Odoo including this addon (from repo root):
```bash
python3 scripts/odoo_web_server.py --db-name mydb --addon payment
```

View file

@ -0,0 +1,3 @@
# Wizards
This module does not include UI wizards.