Skip to content

fix: account.company_id → company_ids for Odoo 18 multi-company#786

Closed
nericervin wants to merge 1 commit intoOCA:18.0from
waikiservicios:18.0
Closed

fix: account.company_id → company_ids for Odoo 18 multi-company#786
nericervin wants to merge 1 commit intoOCA:18.0from
waikiservicios:18.0

Conversation

@nericervin
Copy link
Copy Markdown

Summary

  • Fix AttributeError: 'account.account' object has no attribute 'company_id' when using multi-company mode
  • In Odoo 18, account.account no longer has company_id (single company). It uses company_ids (Many2many) as accounts are shared across companies
  • The fix uses company_ids when available, falling back to company_id for backwards compatibility

Steps to reproduce

  1. Create a MIS report instance with multi_company = True
  2. Configure KPIs with auto_expand_accounts = True
  3. Preview the report → AttributeError on _get_account_name

File changed

  • mis_builder/models/kpimatrix.py - _get_account_name() method

En Odoo 18, account.account no tiene company_id sino
company_ids (Many2many). Fix para multi_company display
de nombres de cuenta.
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @sbidoul,
some modules you are maintaining are being modified, check this out!

@sbidoul
Copy link
Copy Markdown
Member

sbidoul commented Apr 15, 2026

Hi, thanks for your PR. There are several open PRs trying to address this, that I still need to find time to review. The most advanced is probably #782, but there are others. I recommend you like these and provide comments there.

@nericervin
Copy link
Copy Markdown
Author

Thanks @sbidoul. PR #782 is indeed more comprehensive. Closing this in favor of #782. We'll track that one.

@nericervin nericervin closed this Apr 15, 2026
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