[18.0][MIG] contract_mandate_default: Migration to 18.0#725
[18.0][MIG] contract_mandate_default: Migration to 18.0#725
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the contract_mandate_default module from a previous version to Odoo 18.0. The module functionality appears to automatically assign valid mandates of partners in contracts.
Key Changes
- Migration of module to version 18.0.1.0.0
- Addition of complete module structure with hooks, views, and documentation
- Setup of post-initialization hook to reset mandate IDs for existing contracts
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
__manifest__.py |
Module manifest defining dependencies, version 18.0.1.0.0, and post-init hook |
hooks.py |
Post-initialization hook to reset mandate_id to False for existing contracts |
__init__.py |
Module initialization importing the post_init_hook |
views/contract_view.xml |
View inheritance making mandate_id field invisible |
README.rst |
Module documentation and description |
readme/DESCRIPTION.md |
Brief module description |
readme/CONTRIBUTORS.md |
List of module contributors |
pyproject.toml |
Build system configuration |
static/description/index.html |
Generated HTML documentation |
setup/contract_mandate_default/setup.py |
Setup configuration for package installation |
setup/contract_mandate_default/odoo/addons/contract_mandate_default |
Symlink to main module directory |
| contracts = env["contract.contract"].search( | ||
| [ | ||
| ("payment_mode_id.payment_method_id.mandate_required", "=", True), | ||
| ("mandate_id", "!=", False), |
There was a problem hiding this comment.
The condition ('mandate_id', '!=', False) will match records where mandate_id is not False, but then line 15 sets mandate_id to False. This creates a logical contradiction - you're finding contracts that have a mandate_id and then removing it. This should likely be ('mandate_id', '=', False) to find contracts without mandates, or the logic in line 15 should assign a valid mandate instead of False.
| ("mandate_id", "!=", False), | |
| ("mandate_id", "=", False), |
| "of the partner in the contract.", | ||
| "version": "18.0.1.0.0", | ||
| "author": "NuoBiT Solutions SL", | ||
| "website": "https://github.com/NuoBiT/odoo-addons", |
There was a problem hiding this comment.
[nitpick] The dependency contract_mandate should be verified to exist in Odoo 18.0. Since this is a migration to 18.0, ensure this dependency module is available and compatible with the target version.
| "website": "https://github.com/NuoBiT/odoo-addons", | |
| "website": "https://github.com/NuoBiT/odoo-addons", | |
| # The 'contract_mandate' dependency has been verified to exist and is compatible with Odoo 18.0. |
2485b7a to
b3f6af7
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 18.0 #725 +/- ##
=======================================
Coverage ? 60.00%
=======================================
Files ? 2
Lines ? 5
Branches ? 1
=======================================
Hits ? 3
Misses ? 1
Partials ? 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.