← Back to Pull requests

[18.0][FIX] l10n_es_aeat_sii_match: Prevent an access error when accessing the field #5459

Closed
unknown closed this pull request without merging on Nov 27, 2026 17:02 UTC
View on GitHub
unknown unknown commented on Nov 27, 2026 16:28 UTC
Author

Prevent an access error when accessing the field

We need to use sudo() because it's possible that we might reach this point from a pos.order call with a user who lacks permissions for the sii_match_difference_ids field, but we still need to be able to save.

File "/opt/odoo/auto/addons/l10n_es_aeat_sii_match/models/sii_mixin.py", line 293, in _contrast_invoice_to_aeat
    document.write(inv_vals)
Fle "/opt/odoo/auto/addons/l10n_es_aeat_sii_oca/models/account_move.py", line 172, in write
    return super().write(vals)
File "/opt/odoo/auto/addons/account/models/account_move.py", line 3500, in write
    )).write(vals)
File "/opt/odoo/auto/addons/mail/models/mail_thread.py", line 357, in write
    result = super(MailThread, self).write(values)
File "/opt/odoo/auto/addons/mail/models/mail_activity_mixin.py", line 243, in write
    result = super().write(vals)
File "/opt/odoo/auto/addons/account/models/sequence_mixin.py", line 115, in write
    return super().write(vals)
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4737, in write
    self.check_field_access_rights('write', vals.keys())
File "/opt/odoo/auto/addons/account/models/account_move.py", line 3328, in check_field_access_rights
    result = super().check_field_access_rights(operation, field_names)
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3850, in check_field_access_rights
    raise AccessError(error_msg)
odoo.exceptions.AccessError: You do not have enough rights to access the fields "sii_match_difference_ids" on Journal Entry (account.move). Please contact your system administrator.

Operation: write
User: X
Fields:
- sii_match_difference_ids (allowed for groups 'Technical / AEAT manager')

Please @pedrobaeza can you review it?

@Tecnativa TT66124

Diff: 220 lines (+165 / -55) across 2 files Reviewer: pedrobaeza Review duration: 34m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 220 lines diff across 2 files
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Diff Size diff_size
0.323
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5459"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.8% (MEDIUM) · Higher = larger blast radius
36.8%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.5% · Safe to merge
14.5%
Repository