Skip to content

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

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

yordyl wants to merge 17 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).

Assisted-by: Claude Sonnet 5.5

@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

@bosd

bosd commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

@yordyl
Some administrative commits, from translations could be squashed.
please, Check https://github.com/OCA/maintainer-tools/wiki/Merge-commits-in-pull-requests#mergesquash-the-commits-generated-by-bots-or-weblate for details.

@yordyl
yordyl force-pushed the 19.0-mig-purchase_stock_tier_validation branch from f144a05 to da72e22 Compare October 5, 2026 17:07
@OCA-git-bot OCA-git-bot removed the mod:purchase_requisition_tier_validation Module purchase_requisition_tier_validation label Oct 5, 2026
@yordyl

yordyl commented Oct 5, 2026

Copy link
Copy Markdown
Author

@bosd @BhaveshHeliconia Thank you for your comments. This should fix the problems you noted :)

@bosd

bosd commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

@bosd @BhaveshHeliconia Thank you for your comments. This should fix the problems you noted :)

@yordyl Sadly, no, as the AI removed all the commits and kept only the migration one.

@BhaveshHeliconia

Copy link
Copy Markdown

@bosd @BhaveshHeliconia Thank you for your comments. This should fix the problems you noted :)

You need to keep the commit history on top of the migration commit.

BernatPForgeFlow and others added 16 commits October 6, 2026 09:12
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.

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

Changes:
- version bumped to 19.0.1.0.0
- website/links point at OCA/tier-validation (new home)
- README regenerated from readme/*.md fragments
- pyproject.toml added (whool build backend)
- tests modernized: BaseCommon + new_test_user, tagged
  post_install/-at_install
- tests fixed for 19.0 core changes: procurement.group no longer
  exists (Procurement and run() moved to stock.rule),
  purchase.order.line.product_uom renamed product_uom_id

Assisted-by: Claude Sonnet 5.5

Assisted-by: Claude:claude-sonnet-5-5
@yordyl
yordyl force-pushed the 19.0-mig-purchase_stock_tier_validation branch from da72e22 to 7baf0fd Compare October 6, 2026 07:13
@yordyl

yordyl commented Oct 6, 2026

Copy link
Copy Markdown
Author

@bosd @BhaveshHeliconia third time's the charm?

msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 19.0\n"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No need to update the version manually; it will be updated automatically by the OCA bot.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@BhaveshHeliconia thanks. I wasn't sure what you meant here: this line is the Project-Id-Version header of the .pot, generated by Odoo's export, and I haven't changed the manifest version by hand beyond the 19.0.1.0.0 that a [MIG] commit sets. Did you mean the manifest version, or something else in this file?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@yordyotl Yes, I meant the .pot file itself (purchase_stock_tier_validation/i18n/purchase_stock_tier_validation.pot).

In OCA, .pot files and their headers (Project-Id-Version) are generated and updated automatically by the oca-ci bot post-merge (via automated [UPD] Update <module>.pot commits).

To keep migration PRs minimal and avoid translation/Weblate conflicts, we usually don't include .pot file updates in migration commits. Could you please revert/discard the changes to the .pot file from this PR?

Other than that, the test updates look great! Thanks!

)

# Common models
cls.test_partner = cls.env["res.partner"].create({"name": "Partner for test"})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
cls.test_partner = cls.env["res.partner"].create({"name": "Partner for test"})

No need to create a res.partner record when using BaseCommon, as it is already provided by the base class.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

"name": "Test Scrap Component 1",
"type": "consu",
"is_storable": True,
"route_ids": [(6, 0, [route_buy])],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
"route_ids": [(6, 0, [route_buy])],
"route_ids": [Command.set([route_buy])],

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

"is_storable": True,
"route_ids": [(6, 0, [route_buy])],
"seller_ids": [
(0, 0, {"partner_id": cls.test_partner.id, "price": 20.0})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
(0, 0, {"partner_id": cls.test_partner.id, "price": 20.0})
Command.create({"partner_id": cls.test_partner.id, "price": 20.0})

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Comment on lines +61 to +63
(
0,
0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
(
0,
0,
Command.create(

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

…r and Command

Review feedback: reuse the res.partner provided by BaseCommon instead of
creating one, and use Command.set/Command.create instead of raw tuples.

Assisted-by: Claude Sonnet 5.5
@BhaveshHeliconia

Copy link
Copy Markdown

@yordydotl squash the last commit into migration commit.

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

Labels

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.

7 participants