[FIX] analytic: accounts from another company were shown in widget

The accounts shown in the widget could be shown while being in the wrong company.
Previously, only the plans were limited by the company.

closes odoo/odoo#105241

X-original-commit: 97d1afb9ff0ca88dfb0b6a8ed152e39d3db77279
Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
gawa-odoo
2022-11-07 23:39:58 +01:00
parent 8a3dcc8336
commit 732bc1fc7c
@@ -196,6 +196,13 @@ export class AnalyticDistribution extends Component {
async loadOptionsSourceAnalytic(request) {
let domain = [['id', 'not in', this.existingAnalyticAccountIDs]];
if (this.props.record.data.company_id){
domain.push(
'|',
['company_id', '=', this.props.record.data.company_id[0]],
['company_id', '=', false]
);
}
if (this.activeGroup) {
domain.push(['root_plan_id', '=', this.activeGroup]);