Skip to content

Conversation

@geraldo29
Copy link

Summary of Changes Made

  1. KPI Matrix Enhancement (kpimatrix.py) Problem Solved: The original code assumed accounts always had a single company_id field Solution: Enhanced _get_account_name() method to handle both: Single company accounts (company_id field)
    Multi-company accounts (company_ids field)
    Key Improvements:
    Safe field checking with hasattr()
    Smart display limiting to 3 companies max
    Graceful fallback when company info is missing

  2. Accounting Expression Parser Enhancement (aep.py) Problem Solved: Runtime errors when processing accounting data from companies not pre-loaded in company_rates Solution: Added dynamic company rate calculation
    Key Improvements:
    On-demand rate calculation for missing companies
    Proper currency conversion handling

Description

Did not create issue

Test

added unit tests

@OCA-git-bot
Copy link
Contributor

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

Summary of Changes Made
1. KPI Matrix Enhancement (kpimatrix.py)
Problem Solved: The original code assumed accounts always had a single company_id field
Solution: Enhanced _get_account_name() method to handle both:
Single company accounts (company_id field)
Multi-company accounts (company_ids field)
Key Improvements:
Safe field checking with hasattr()
Smart display limiting to 3 companies max
Graceful fallback when company info is missing

2. Accounting Expression Parser Enhancement (aep.py)
Problem Solved: Runtime errors when processing accounting data from companies not pre-loaded in company_rates
Solution: Added dynamic company rate calculation
Key Improvements:
On-demand rate calculation for missing companies
Proper currency conversion handling

Unit Tests

add env mock constructors

pre commit

test fix

test fix

remove validate

remove unhashable type list
@geraldo29 geraldo29 force-pushed the IMP]-mis_builder-enhance-multi-company-support branch from cc638a6 to 537c065 Compare June 25, 2025 08:59
@BhaveshHeliconia
Copy link

LGTM!

@BhaveshHeliconia
Copy link

Hello @OCA/mis-builder-maintainers is this possible to merge, already checked and working fine.

@sbidoul
Copy link
Member

sbidoul commented Jul 28, 2025

Hello, could you do separate PRs for the two topics, which seem independent? This is will facilitate review.

Also, please don't mix bug fixes and improvements, that will also make things quicker to review.

@speltot
Copy link

speltot commented Aug 5, 2025

The KPI Matrix Enhancement (kpimatrix.py) fix works

@sbidoul sbidoul added the 18.0 label Aug 11, 2025
@StefanRijnhart
Copy link
Member

@geraldo29 Thanks for the fixes! Because you seem to be too busy to follow-up, I've split up the account company_id issue to #730 as the reviewer requested.

@sbidoul sbidoul added the bugfix label Oct 27, 2025
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.

6 participants