User default company in reports falls back to global default

when setup is done Company A is created. After that Company B / Company C and Company D is created.
User X is given access to Company B and Company C.
User Permission list shows it correctly.
When User X is logged in he sees correct company in sales invoice company dropdown and its default is also correct.
But for report say trail balance the default is always global default company ie. Company A.
frappe.defaults.get_user_default(“company”) OR frappe.defaults.get_user_default(“Company”)
always returns Company A

Problem is with default only. If we goes and check the company options it shows correct list for which user has access to i.e. Company B and C and once any of this is selected, you no longer see the incorrect Company A.

Exact same bug was reported 4339 and it is in closed state.
In latest version , i still see the issue.
Help required, how to fix this? thanks.

1 Like