Skip to content

[19.0][MIG] agreement_account: Migration to 19.0#112

Open
SyncMasta wants to merge 4 commits into
OCA:19.0from
SyncMasta:19.0-mig-agreement_account
Open

[19.0][MIG] agreement_account: Migration to 19.0#112
SyncMasta wants to merge 4 commits into
OCA:19.0from
SyncMasta:19.0-mig-agreement_account

Conversation

@SyncMasta

@SyncMasta SyncMasta commented May 3, 2026

Copy link
Copy Markdown

Summary

Migrates agreement_account from 18.0 to 19.0. Marked as Draft so OCA CI can validate it without adding review-queue pressure while #111 (agreement_legal) is still pending.

Two commits:

  1. init migration — copies the 18.0 source verbatim with the manifest bumped to 19.0.1.0.0 and an empty migrations/19.0.1.0.0/pre-migration.py placeholder.
  2. 19.0 API + prettier format — applies the only 19.0 breaking change in this module (read_group_read_group at 2 sites in _compute_invoice_count) plus prettier-XML normalisation across the view files.

Net change: 1 production code file (models/agreement.py), 2 view files reformatted.

19.0 API adaptation

read_group was removed in 19.0; replaced both call sites with _read_group using the new groupby= / aggregates= keyword form, which returns recordset tuples directly:

# 18.0
rg = aio.read_group(domain, ["agreement_id"], ["agreement_id"])
data = {x["agreement_id"][0]: x["agreement_id_count"] for x in rg}

# 19.0
rg = aio._read_group(domain, groupby=["agreement_id"], aggregates=["__count"])
data = {agreement.id: count for agreement, count in rg}

The change is local to _compute_invoice_count on the inherited agreement model. No other 19.0-API touches were needed (no _() translation calls, no res.groups records, no multi-_inherit, no target='inline' actions, no lambda-default fields, no wizard/view ordering issues — all the categories that bit us in #111).

Dependencies

Test plan

  • OCA CI: pre-commit, test with Odoo, test with OCB, codecov
  • Reviewers: confirm Smart-Buttons (Invoices, Vendor Bills) on the agreement form still render correct counts under the new _read_group mapping

Related

🤖 Generated with Claude Code

SyncMasta and others added 2 commits May 3, 2026 16:39
Initial migration commit: copy agreement_account from 18.0 with manifest
bumped to 19.0.1.0.0 and an empty migrations/19.0.1.0.0/pre-migration.py
to mark the version step explicitly.

This commit is intentionally functionality-equivalent to the 18.0 state.
The follow-up commit applies the 19.0 API breaking changes (read_group
to _read_group on the agreement._compute_invoice_count compute method).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
read_group has been removed in 19.0. Migrated _compute_invoice_count
in agreement.py from the old (domain, fields, groupby) tuple form to
the new _read_group(domain, groupby=, aggregates=) form, which returns
recordset tuples directly:

  # 18.0
  rg = aio.read_group(domain, ['agreement_id'], ['agreement_id'])
  data = {x['agreement_id'][0]: x['agreement_id_count'] for x in rg}

  # 19.0
  rg = aio._read_group(domain, groupby=['agreement_id'],
                       aggregates=['__count'])
  data = {agreement.id: count for agreement, count in rg}

Also: prettier @prettier/plugin-xml@3.4.2 normalisation across the
view files and readme/, no semantic XML changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@OCA-git-bot OCA-git-bot added series:19.0 mod:agreement_account Module agreement_account labels May 3, 2026
SyncMasta and others added 2 commits May 3, 2026 20:19
The XML ID 'account.account_management_menu' was removed in Odoo 19.0
(ValueError: External ID not found in the system: account.account_
management_menu). The 18.0 menu was a top-level 'Management' entry
under group_account_manager.

In 19.0 the Account top-level structure was reorganised:
  - account.account_management_menu       — gone
  - account.account_reports_management_menu  — under Reports tree
  - account.menu_finance_configuration     — top-level 'Configuration'
    under group_account_manager

Choosing menu_finance_configuration: it's the semantic equivalent
(top-level, Account-Manager-only) and is the right home for the
agreement-type setup action this menu hosts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The parent view account.view_account_invoice_filter no longer wraps
its group-by filters in <group expand="0">; in 19.0 the container
is a plain <group> with no attributes. The 18.0 inheritance form

  <group expand="0" position="inside">

cannot locate that element and fails with
  ParseError: Element '<group expand="0">' cannot be located in
  parent view

Switch to a positional xpath that matches the first group inside
the search element, which is the group-by container regardless of
whether it carries an expand attribute.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@SyncMasta SyncMasta marked this pull request as ready for review May 25, 2026 08:58
@max3903 max3903 added this to the 19.0 milestone Jun 26, 2026
@max3903 max3903 self-assigned this Jun 26, 2026
@max3903

max3903 commented Jun 26, 2026

Copy link
Copy Markdown
Member

/ocabot migration agreement_account

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants