Skip to content

[18.0][MIG] contract_mandate_default: Migration to 18.0#725

Open
deeniiz wants to merge 5 commits into18.0from
18.0-mig-contract_mandate_default
Open

[18.0][MIG] contract_mandate_default: Migration to 18.0#725
deeniiz wants to merge 5 commits into18.0from
18.0-mig-contract_mandate_default

Conversation

@deeniiz
Copy link
Copy Markdown
Collaborator

@deeniiz deeniiz commented Sep 29, 2025

No description provided.

Copilot AI review requested due to automatic review settings September 29, 2025 16:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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),
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
("mandate_id", "!=", False),
("mandate_id", "=", False),

Copilot uses AI. Check for mistakes.
"of the partner in the contract.",
"version": "18.0.1.0.0",
"author": "NuoBiT Solutions SL",
"website": "https://github.com/NuoBiT/odoo-addons",
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
"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.

Copilot uses AI. Check for mistakes.
@deeniiz deeniiz force-pushed the 18.0-mig-contract_mandate_default branch from 2485b7a to b3f6af7 Compare March 12, 2026 11:51
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (18.0@4b294fd). Learn more about missing BASE report.

Files with missing lines Patch % Lines
contract_mandate_default/hooks.py 50.00% 1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants