Skip to content

[19.0][FIX] sales_team_operating_unit: default company from operating unit - #878

Open
parabol123654 wants to merge 1 commit into
OCA:19.0from
parabol123654:19.0-fix-sales_team_operating_unit-default-company
Open

parabol123654 wants to merge 1 commit into
OCA:19.0from
parabol123654:19.0-fix-sales_team_operating_unit-default-company

Conversation

@parabol123654

@parabol123654 parabol123654 commented Oct 30, 2026 •

Copy link
Copy Markdown

Port of #856 (18.0) to 19.0.

Problem: a new sales team gets the user's default operating unit (operating_unit_id default) but no company. Users without multi-company access do not see company_id, so when such a sales manager creates a team, saving fails:

UserError: Uh-oh! You’ve got some company inconsistencies here: ...

Fix: in default_get, default company_id to the company of the default operating unit, as in 18.0.

Test: test_create_team_single_company_user creates a team through a Form as a single-company sales manager (the 18.0 test runs as admin, which has the multi-company group). Without the fix it fails with the error above; with the fix the module's tests pass, as do those of crm_operating_unit (Odoo 19.0).

Assisted-by: Claude Opus 5.5

@OCA-git-bot OCA-git-bot added series:19.0 mod:sales_team_operating_unit Module sales_team_operating_unit labels Oct 30, 2026

@AaronHForgeFlow AaronHForgeFlow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 thanks for the FW port

A new sales team gets the user's default operating unit, but no company.
Users without multi-company access do not see the company field, so
saving the team failed with "company inconsistencies" between the team
and its operating unit. Default the company to the one of the operating
unit, as done in 18.0 (OCA#856).

Assisted-by: Claude Opus 5.5
@parabol123654
parabol123654 force-pushed the 19.0-fix-sales_team_operating_unit-default-company branch from 7fa9407 to c066e13 Compare November 14, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:sales_team_operating_unit Module sales_team_operating_unit series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants