Skip to content

[20.0][MIG] product_operating_unit: Migration to 20.0 - #904

Open
miguel-S73 wants to merge 34 commits into
OCA:20.0from
miguel-S73:20-TA44165
Open

miguel-S73 wants to merge 34 commits into
OCA:20.0from
miguel-S73:20-TA44165

Conversation

@miguel-S73

Copy link
Copy Markdown

Summary

Migrate product_operating_unit to Odoo 20.0 while preserving its commit history from 19.0.

  • Move product template and category rules to ir.access, preserving their XML IDs, domains, and global read-only scope.
  • Select an accessible, company-compatible default category for product templates and directly created variants.
  • Preserve operating unit inheritance from categories and propagation to products in descendant categories.
  • Update and expand the tests for operating unit visibility, multi-company isolation, access cache invalidation, and CRUD permissions.

Depends on:

The temporary dependency is in the [DON'T MERGE] test-requirements.txt commit, which can be dropped once #871 is merged.

mara1 and others added 30 commits November 26, 2026 13:34
Co-Authored-By: Patrick Wilson <36892066+patrickrwilson@users.noreply.github.com>
Currently translated at 100.0% (7 of 7 strings)

Translation: operating-unit-16.0/operating-unit-16.0-product_operating_unit
Translate-URL: https://translation.odoo-community.org/projects/operating-unit-16-0/operating-unit-16-0-product_operating_unit/es/
Currently translated at 14.2% (1 of 7 strings)

Translation: operating-unit-16.0/operating-unit-16.0-product_operating_unit
Translate-URL: https://translation.odoo-community.org/projects/operating-unit-16-0/operating-unit-16-0-product_operating_unit/ja/
This PR fixes an issue with the method operating_unit_default_get
where it would return an operating unit even for a company that was
not active, which would cause all sorts of issues

Steps to reproduce on runboat,
taking as example purchase_operating_unit:

- User has a default ou belonging to Company 1
- Switch to Company 2 (make sure Company 1 is not active at all)
- Try to create a Purchase Order

The issue arises because the operating_unit field is pre-compiled
on the PO with an Operating Unit whose company is inactive,
and the onchanges cannot find or access related data.
Currently translated at 100.0% (7 of 7 strings)

Translation: operating-unit-16.0/operating-unit-16.0-product_operating_unit
Translate-URL: https://translation.odoo-community.org/projects/operating-unit-16-0/operating-unit-16-0-product_operating_unit/it/
@oca-cla-bot

oca-cla-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

CLA not signed

@OCA-git-bot OCA-git-bot added series:20.0 mod:product_operating_unit Module product_operating_unit labels Nov 26, 2026
@miguel-S73 miguel-S73 mentioned this pull request Nov 26, 2026
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:product_operating_unit Module product_operating_unit series:20.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.