Skip to content

[19.0][MIG] purchase_stock_tier_validation: Migration to 19.0 - #63

Open
yordyl wants to merge 31 commits into
OCA:19.0from
yordyl:19.0-mig-purchase_stock_tier_validation
Open

yordyl wants to merge 31 commits into
OCA:19.0from
yordyl:19.0-mig-purchase_stock_tier_validation

Conversation

@yordyl

@yordyl yordyl commented Sep 11, 2026

Copy link
Copy Markdown

Migration of purchase_stock_tier_validation to 19.0.

The module last existed at 16.0 (in OCA/purchase-workflow) and was never
carried forward through the 17.0 migration there — no deletion commit, it
simply wasn't ported. Its sibling *_tier_validation modules were relocated
to OCA/tier-validation during the 17.0/18.0 era, so this migration follows
suit and lands it here instead of its historical repo.

No functional changes: _make_po_get_domain (the stock.rule hook this
module extends) and review_ids (from base_tier_validation) are both
unchanged in 19.0, so the module's logic still applies as-is.

Changes beyond the version bump:

  • manifest version 19.0.1.0.0, links point at this repo
  • README regenerated from readme/*.md fragments
  • pyproject.toml added (whool build backend)
  • tests modernized: BaseCommon + new_test_user, tagged
    post_install/-at_install (avoids a module-load-order hazard when other
    installed modules add required fields to res.partner/res.company)
  • test fixed for two 19.0 core changes: procurement.group no longer exists
    as a model (its Procurement namedtuple and run() moved to stock.rule),
    and purchase.order.line.product_uom was renamed product_uom_id

Tested locally: installs cleanly alongside base_tier_validation and
purchase_tier_validation, test suite green (0 failed, 0 error(s) of 1 tests).

ps-tubtim and others added 30 commits July 24, 2026 09:52
Currently translated at 100.0% (13 of 13 strings)

Translation: purchase-workflow-13.0/purchase-workflow-13.0-purchase_requisition_tier_validation
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-13-0/purchase-workflow-13-0-purchase_requisition_tier_validation/zh_CN/
Currently translated at 100.0% (13 of 13 strings)

Translation: purchase-workflow-13.0/purchase-workflow-13.0-purchase_requisition_tier_validation
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-13-0/purchase-workflow-13-0-purchase_requisition_tier_validation/zh_CN/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_requisition_tier_validation
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_requisition_tier_validation/
Currently translated at 100.0% (16 of 16 strings)

Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_requisition_tier_validation
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_requisition_tier_validation/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_requisition_tier_validation
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_requisition_tier_validation/
Currently translated at 100.0% (17 of 17 strings)

Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_requisition_tier_validation
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_requisition_tier_validation/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: purchase-workflow-17.0/purchase-workflow-17.0-purchase_requisition_tier_validation
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_requisition_tier_validation/
Currently translated at 100.0% (18 of 18 strings)

Translation: purchase-workflow-17.0/purchase-workflow-17.0-purchase_requisition_tier_validation
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_requisition_tier_validation/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: purchase-workflow-17.0/purchase-workflow-17.0-purchase_requisition_tier_validation
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_requisition_tier_validation/
Currently translated at 100.0% (19 of 19 strings)

Translation: purchase-workflow-17.0/purchase-workflow-17.0-purchase_requisition_tier_validation
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_requisition_tier_validation/es/
Currently translated at 26.3% (5 of 19 strings)

Translation: purchase-workflow-17.0/purchase-workflow-17.0-purchase_requisition_tier_validation
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_requisition_tier_validation/it/
Currently translated at 100.0% (19 of 19 strings)

Translation: purchase-workflow-17.0/purchase-workflow-17.0-purchase_requisition_tier_validation
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_requisition_tier_validation/it/
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…equisition_tier_validation

19.0 mig purchase requisition tier validation
Module last existed at 16.0 in OCA/purchase-workflow and was never
carried forward through the 17.0 migration. Relocated alongside its
sibling *_tier_validation modules, now living in OCA/tier-validation
since the 17.0-18.0 reorganization of tier-validation-related addons.

_make_po_get_domain (purchase_stock's StockRule hook) and the
review_ids field from base_tier_validation are both unchanged in
19.0, so the module logic still applies as-is: RFQs under or past
tier validation keep being excluded when Odoo looks for a PO to
merge new procurements into.

Changes:
- version bumped to 19.0.1.0.0
- website/links point at OCA/tier-validation (new home)
- README regenerated from readme/*.md fragments (oca-gen-addon-readme
  template, .rst fragments converted to .md)
- pyproject.toml added (whool build backend, no more setup.py)
- tests modernized: BaseCommon + new_test_user instead of manual
  TransactionCase/res.users setup; product type "product" replaced by
  consu + is_storable (Odoo 17 product type simplification)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJTkDfNHvA4uGRZ5hpwvEh
Validated locally against a symphonie_new (production-copy) DB with the
full Odoo 19 + Enterprise stack. Two real, confirmed-against-core issues:

- procurement.group no longer exists as a model in 19.0 core (verified:
  zero hits for it anywhere in odoo/addons or odoo/odoo/addons, and it's
  gone from the loaded registry). The Procurement namedtuple and its
  run() method moved onto stock.rule instead
  (odoo/addons/stock/models/stock_rule.py). Test now calls
  self.env["stock.rule"].Procurement(...) / .run(...) directly, no
  procurement.group record created.
- purchase.order.line.product_uom renamed to product_uom_id.

Also tag the test class post_install (not at_install): at_install it ran
before syd_partner_extended -- a module that's loaded later in this DB's
module graph and adds a required res.partner.state column -- had
registered its field, so BaseCommon's generic partner creation hit a
NOT NULL violation on a column the ORM didn't know about yet at that
point in the load order. Not a bug in syd_partner_extended; it's a
general hazard for any at_install test that creates generic res.partner/
res.company records via BaseCommon.

Result: 0 failed, 0 error(s) of 1 tests.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJTkDfNHvA4uGRZ5hpwvEh
@OCA-git-bot OCA-git-bot added series:19.0 mod:purchase_requisition_tier_validation Module purchase_requisition_tier_validation mod:purchase_stock_tier_validation Module purchase_stock_tier_validation labels Sep 11, 2026

@BhaveshHeliconia BhaveshHeliconia left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the commit history doesn't look correct here. I can see commits from purchase_requisition_tier_validation that seem unrelated to purchase_stock_tier_validation module.

@BhaveshHeliconia

Copy link
Copy Markdown

You shouldn't add the AI agent as a co-author. It should be mentioned as assisted by AI according to the OCA AI policy: https://github.com/OCA/.github/blob/master/AI_POLICY.md

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

Labels

mod:purchase_requisition_tier_validation Module purchase_requisition_tier_validation mod:purchase_stock_tier_validation Module purchase_stock_tier_validation series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.