Skip to content

[12.0][FIX] account_move_multi_company: call super().post() with invoice as keyword - #1

Merged
HviorForgeFlow merged 1 commit into
12.0-hobbiifrom
12.0-fix-post-invoice-kwarg
Aug 6, 2026
Merged

[12.0][FIX] account_move_multi_company: call super().post() with invoice as keyword#1
HviorForgeFlow merged 1 commit into
12.0-hobbiifrom
12.0-fix-post-invoice-kwarg

Conversation

@HviorForgeFlow

Copy link
Copy Markdown

Summary

  • `super().post(invoice)` forwards the optional `invoice` argument positionally.
  • That only works by coincidence when every class in `account.move`'s MRO also declares `invoice` as a plain positional-or-keyword parameter - a downstream consumer (hobbii) hit a `TypeError: post() takes 1 positional argument but 2 were given` while investigating this exact chain.
  • Pass it by keyword instead, matching the module's own declared signature (`post(self, invoice=False)`).

… keyword

super().post(invoice) passes it positionally, which only works by
coincidence when every class in account.move's MRO happens to also
declare invoice as a plain positional-or-keyword parameter. Passing
it by name is the safer, unambiguous way to forward an optional
argument through an inheritance chain this deep.
@HviorForgeFlow
HviorForgeFlow merged commit cbcabfb into 12.0-hobbii Aug 6, 2026
1 of 3 checks passed
JasminSForgeFlow pushed a commit that referenced this pull request Sep 1, 2026
* Revert "Revert hook view create back to model init"

This reverts commit 770bd71.

* [FIX] base_multi_company: Always create the view into a pre_init_hook to avoid error in log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant