← Back to Pull requests

[19.0][MIG] l10n_es_pos_oca: Migration to 19.0 #5356

Open
unknown opened this pull request with 369 lines diff across 4 files
View on GitHub
unknown unknown commented on Nov 02, 2026 15:30 UTC
Author

Migration of l10n_es_pos_oca to 19.0, keeping the 18.0 behaviour. Only the changes required by 19.0 or by the CI have been made:

Required by 19.0

  • pos.order._update_sequence_number is now a core method (called from create with (session, values)), so the module method is renamed to _l10n_es_update_sequence_number. Without it, any POS order creation raises a TypeError.

  • PaymentScreen: get_total_with_tax() no longer exists, replaced by priceIncl.

  • PosStore: new import path (app/services/pos_store). getReceiptHeaderData no longer exists, the 19.0 receipt reads the order directly.

  • PosOrder: export_for_printing no longer exists. The tax base per tax is already printed by the 19.0 receipt when the bases differ.

  • TicketScreen: the search field uses modelFields (list) instead of modelField. The order list is now a table without header row, so the simplified invoice number is added as a new cell (and as a block in the mobile layout).

  • Receipt header: the 19.0 header already prints a "VAT Ticket <order reference>" line for European companies ("Factura simplificada <reference>" in Spanish), so the simplified invoice number now replaces the order reference in that line instead of adding a second "Simplified invoice" block. The company address and the customer name, VAT and address added in 18.0 are already printed by the 19.0 receipt.

  • Tests: account.account.deprecated no longer exists.
  • Required by the CI

  • self.env._() instead of _() (pylint-odoo W8161 / W8301).

  • f-string in hooks.py (ruff UP031).

  • self.env.context instead of self._context (deprecated since 19.0).
  • Dead code removed (open to other opinions)

  • models/pos_session.py: _loader_params_res_company does not exist in the core since 18.0, so this override was never called.

  • pos.order._order_fields: same, the core method does not exist since 18.0.

  • PosOrder.init_from_JSON / export_as_JSON in JS: not in the core since 18.0.
  • Receipt QR override removed (open to other opinions)

  • The 18.0 override in order_receipt.xml (props.data.pos_qr_code or props.data.ticket_code and (...)) only changes the "Need an invoice for your purchase ?" text, not the QR image, and because of the operator precedence that text is shown whenever there is a QR code. So in 18.0 the invoice request QR is printed on simplified invoices too. In 19.0 the QR, the text and the code are a single pos-receipt-qr block and the 18.0 xpath no longer matches, so the override is removed to keep the 18.0 behaviour. If hiding the QR on simplified invoices (the 17.0 behaviour) is preferred, it can be done on that block.
  • Tested on a clean 19.0 database (16 tests OK) and on a copy of a production database with 12 POS: sequences and existing numbers are kept after the upgrade, receipts get the next number, orders over the limit are forced to be invoiced, and the number can be seen and searched in the order list.

    Diff: 369 lines (+276 / -93) across 4 files Reviewer: adasatorres-tecnativa Review duration: 40981m
    All Vouch review confidence checks passed
    Residual risk 0.35 = Change Risk (0.66) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.66 · 369 lines diff across 4 files
    0.66
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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.354
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.066
    Real PR Conversation Timeline
    1 comments
    "Review active on #5356"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 46.7% reviewed sensitive_module
    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: 66.0% (HIGH) · Higher = larger blast radius
    66.0%
    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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 35.1% · Moderate risk
    35.1%
    Repository