[19.0][MIG] agreement_account: Migration to 19.0#112
Open
SyncMasta wants to merge 4 commits into
Open
Conversation
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) <[email protected]>
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/[email protected] normalisation across the
view files and readme/, no semantic XML changes.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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) <[email protected]>
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) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates
agreement_accountfrom 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:
init migration— copies the 18.0 source verbatim with the manifest bumped to19.0.1.0.0and an emptymigrations/19.0.1.0.0/pre-migration.pyplaceholder.19.0 API + prettier format— applies the only 19.0 breaking change in this module (read_group→_read_groupat 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_groupwas removed in 19.0; replaced both call sites with_read_groupusing the newgroupby=/aggregates=keyword form, which returns recordset tuples directly:The change is local to
_compute_invoice_counton the inheritedagreementmodel. No other 19.0-API touches were needed (no_()translation calls, nores.groupsrecords, no multi-_inherit, notarget='inline'actions, nolambda-default fields, no wizard/view ordering issues — all the categories that bit us in #111).Test plan
pre-commit,test with Odoo,test with OCB,codecov_read_groupmappingRelated
agreement✅ ([19.0][MIG] agreement: Migration to 19.0 #99)agreement_rebate*✅ ([19.0][MIG] agreement_rebate: Migration to 19.0 #108, [19.0][MIG] agreement_rebate_partner_company_group: Migration to 19.0 #110)agreement_sale🟡 ([19.0][MIG] agreement_sale: Migration to 19.0 #100, open, all checks green)agreement_legal🟡 ([19.0][MIG] agreement_legal: Migration to 19.0 #111, open, all checks green — same author)agreement_account🟡 (this PR)🤖 Generated with Claude Code