[19.0][FIX] partner_company_default: don't stomp an explicit company assignment #2401
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.46) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 246 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.330
Real PR Conversation Timeline
1 comments
"Review active on #2401"
general
weight: 0.35
luisDIXMIT
Problem
The default on
company_idis applied whenever the key is missing from thecreate()values, even when the company is being assigned some other way.This composes badly with OCA's
base_multi_company(multi-company repo), wherecompany_idbecomes a computed field whose inverse replaces the realcompany_ids:create({"name": "X", "company_ids": [(6, 0, [company_b.id])]})silently ends up withcompany_ids = [active company]— the explicit assignment is stomped by the default's inverse. Easy to hit from imports or RPC.test_enable: the guard'sFalsereturn still counts as an assigned value, fires the inverse, and wipescompany_idsentirely — making severalpartner_multi_companytests fail whenever both modules are installed in the same test run.Reproduction (production conditions, both modules installed):
Fix
Replace the field default with a
create()override that only fills the company in when no company information was provided at all (neithercompany_idnorcompany_idsin the values — a plain dict check, so no dependency on the multi-company modules).Standalone behaviour is unchanged:
creating_from_companyguard),An explicit company — either
company_idor a multi-companycompany_ids— is now always respected.Testing
company_id).base_multi_company/partner_multi_company: explicitcompany_idspreserved, defaulting still applies when nothing is passed, and the previously failing combined test runs go green.