Skip to content

[16.0][ADD] project_purchase_budget: add new module - #24

Open
marcelsavegnago wants to merge 2 commits into
16.0from
16.0-add-project_purchase_budget
Open

[16.0][ADD] project_purchase_budget: add new module#24
marcelsavegnago wants to merge 2 commits into
16.0from
16.0-add-project_purchase_budget

Conversation

@marcelsavegnago

@marcelsavegnago marcelsavegnago commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces a new Odoo module, project_purchase_budget, which enforces purchase budget controls at the project level. The module allows project managers to set a maximum percentage of the sale value that can be spent on purchases for a project. When purchase orders exceed this budget, a tier validation process is triggered. The implementation includes models, security rules, tier validation definitions, and comprehensive documentation.

The most important changes are:

Core Functionality Implementation:

  • Added the main module manifest (__manifest__.py) declaring dependencies, data files, and metadata for project_purchase_budget.
  • Implemented the ProjectProject model extension in project_project.py to track and compute purchase budget KPIs (budget, spent, remaining, consumed %, and contribution), and to determine if the current user is a purchase budget manager.
  • Extended the PurchaseOrder model in purchase_order.py to compute if a purchase order exceeds any linked project's budget, trigger tier validation, and ensure correct recalculation and invalidation of related KPIs.

Tier Validation and Security:

  • Added a tier validation rule in tier_definition_data.xml to require approval when a purchase order exceeds the project budget, and defined the necessary security group.

Documentation:

  • Added a comprehensive README.rst and additional documentation files (INSTALL.rst, CONFIGURE.rst, USAGE.rst, DESCRIPTION.rst, CONTRIBUTORS.rst) describing the module's purpose, installation, configuration, usage, and credits. [1] [2] [3] [4] [5] [6]

These changes collectively provide a robust framework for project purchase budget management with validation and clear user guidance.

@marcelsavegnago
marcelsavegnago marked this pull request as ready for review July 15, 2026 17:18
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.35691% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.63%. Comparing base (e6370f8) to head (8ed20ba).

Files with missing lines Patch % Lines
project_purchase_budget/models/project_project.py 98.80% 0 Missing and 1 partial ⚠️
...chase_budget/tests/test_project_purchase_budget.py 99.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             16.0      #24      +/-   ##
==========================================
+ Coverage   92.85%   97.63%   +4.77%     
==========================================
  Files           9       15       +6     
  Lines         112      423     +311     
  Branches        6       31      +25     
==========================================
+ Hits          104      413     +309     
  Misses          5        5              
- Partials        3        5       +2     

☔ View full report in Codecov by Harness.
📢 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.

@marcelsavegnago
marcelsavegnago force-pushed the 16.0-add-project_purchase_budget branch 2 times, most recently from 62bf850 to de97be0 Compare July 15, 2026 18:02
@marcelsavegnago
marcelsavegnago force-pushed the 16.0-add-project_purchase_budget branch from de97be0 to 8ed20ba Compare July 15, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant