Skip to content

[19.0][MIG] mrp_request: Migration to 19.0 task#32273 - #12

Merged
alan196 merged 4 commits into
Jarsa:19.0from
Jarsa-dev:19.0-mig-mrp_request
Aug 12, 2026
Merged

alan196 merged 4 commits into
Jarsa:19.0from
Jarsa-dev:19.0-mig-mrp_request

Conversation

@alan196

@alan196 alan196 commented Aug 12, 2026 •

Copy link
Copy Markdown

Migration of mrp_request from 17.0 to 19.0, ported with oca-port (history preserved).

Odoo 19.0 adaptations

  • Replace procurement.group usage with stock.reference (reference_ids on the request, propagated to the MOs created from the wizard).
  • _run_manufacture is now @api.model and dispatches per (procurement, rule); overrides updated accordingly.
  • _generate_finished_moves was replaced by _create_update_move_finished.
  • res.users.groups_id → all_group_ids, res.groups.category_id → privilege_id (new res.groups.privilege record), users → user_ids.
  • UoM categories were removed in 19.0: dropped category_uom_id and its domain.
  • Dropped stock_free_quantity dependency (free_qty is part of stock core since v14).
  • Translations use self.env._().

Improvements

  • Route configuration: new Manufacturing Request checkbox on warehouse routes (stock.route). Procurements resolved through a Manufacture or Buy rule of a flagged route generate a Manufacturing Request instead of a manufacturing/purchase order (product-level checkbox still available). This adds a purchase_stock dependency.
  • Incoming quantity: confirmed requests (to approve/approved) are now considered incoming quantity:
    • Forecasted report: new Confirmed Manufacturing Requests line (pending quantity).
    • Forecasted inventory graph: report.stock.quantity SQL view is wrapped to include pending request quantities as forecasted receipts.
    • Replenishment: reordering rules count the pending quantity of open requests (previously it used a non-existent state and the full quantity, over-counting once MOs were created).

Data migration

  • migrations/19.0.1.0.0/post-migration.py maps the legacy procurement_group_id column to the new reference_ids many2many. OpenUpgrade renames procurement_group → stock_reference keeping the ids, so the mapping is direct (verified by simulating the legacy schema and running the upgrade).

Tests

  • Rewritten for 19.0 (stock.rule.run / Procurement namedtuple, is_storable products).
  • 10 tests, 100% coverage of the module (manifest excluded).

🤖 Generated with Claude Code

@jarsabot

Copy link
Copy Markdown

Linked to Odoo task #32273

@codecov-commenter

codecov-commenter commented Aug 12, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (19.0@37f4e96). Learn more about missing BASE report.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             19.0      #12   +/-   ##
=======================================
  Coverage        ?   92.12%           
=======================================
  Files           ?       92           
  Lines           ?     2819           
  Branches        ?      252           
=======================================
  Hits            ?     2597           
  Misses          ?      163           
  Partials        ?       59           

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

@alan196
alan196 force-pushed the 19.0-mig-mrp_request branch from ac96ed8 to f2e90a5 Compare August 12, 2026 18:50
Adaptations to Odoo 19.0:
- Replace procurement.group usage with stock.reference (reference_ids).
- _run_manufacture is @api.model and dispatches per (procurement, rule).
- _generate_finished_moves was replaced by _create_update_move_finished.
- res.users groups_id -> all_group_ids, res.groups category_id ->
  privilege_id, users -> user_ids.
- UoM categories were removed in 19.0 (drop category_uom_id).
- Drop stock_free_quantity dependency (free_qty is in stock core).
- Use self.env._() for translations.

Improvements:
- Allow flagging warehouse routes (stock.route) to generate manufacturing
  requests instead of manufacturing or purchase orders; buy procurements
  are also diverted (new purchase_stock dependency).
- Confirmed requests are considered as incoming quantity: forecasted
  report, forecasted inventory graph (report.stock.quantity) and
  replenishment (reordering rules use pending_qty and all open states).
- Tests rewritten with 100% coverage.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@alan196
alan196 force-pushed the 19.0-mig-mrp_request branch from f2e90a5 to 6ae768d Compare August 12, 2026 18:52
@alan196
alan196 merged commit 3d8c8ab into Jarsa:19.0 Aug 12, 2026
4 checks passed
@alan196
alan196 deleted the 19.0-mig-mrp_request branch August 12, 2026 19:32
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.

4 participants