Skip to content

[18.0][MIG] web_select_all_companies: Migration to 18.0 - #3340

Open
natuan9 wants to merge 10 commits into
OCA:18.0from
natuan9:18.0-mig-web_select_all_companies
Open

natuan9 wants to merge 10 commits into
OCA:18.0from
natuan9:18.0-mig-web_select_all_companies

Conversation

@natuan9

@natuan9 natuan9 commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

Changes

  • The "Select All Companies" feature was added in version 18.0 (from this commit). The "Select All" checkbox is displayed when there are 10 or more companies. In MIG commit, I customized it so that the "Select All" checkbox is displayed when there is more than one company.
  • Added default_company_ids field to res.users that will control which companies are selected by default

@DorianMAG DorianMAG left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the migration.
Functional test on runboat.
LGTM

@JulienMartinez JulienMartinez left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional test on runboat.
LGTM
thx

@flotho flotho left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks,
successfully tested on runboat

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@natuan9
natuan9 force-pushed the 18.0-mig-web_select_all_companies branch from 7fbb070 to c7497f3 Compare October 27, 2025 03:57
@natuan9

natuan9 commented Oct 27, 2025

Copy link
Copy Markdown
Contributor Author

Hi, thanks for your review! I've just made a small change.
Most users don't have access to the res.user form, so we also need to display default_company_ids field in the Preferences form.

@ivs-cetmix

Copy link
Copy Markdown
Member

Hey @natuan9 could you please squash the administrative commits (the ones with the [UPD].. tag) if you are comfortable with it?
@flotho could you please check if the recent change is working fine?

@natuan9
natuan9 force-pushed the 18.0-mig-web_select_all_companies branch from c7497f3 to 4840b6f Compare December 23, 2025 03:08
@tarteo

tarteo commented Apr 16, 2026

Copy link
Copy Markdown
Member

/ocabot migration web_select_all_companies

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Apr 16, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Apr 16, 2026
49 tasks

@tarteo tarteo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we should remove translation files, I couldn't test it on Runboat, but as 3 people already reviewed I assume it's okay!

This module allows you to select or deselect all the companies in a
single click.

![image](./static/description/select_all_companies.png)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file doesn't exist

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you want to add your videos here?

@HekkiMelody HekkiMelody left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from the small fixes to the readme that have already been pointed out,

Code and functional review, LGTM

@SirPyTech SirPyTech left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!
I tried it and works great, nice work! 👏

I have reviewed the code and I'm a bit worried of the missing super calls in the overrides, please let me know what you think about those.

I have also reviewed the commit history and some commits from 16.0 are missing, while others should still be squashed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chore: This migration is missing commits d7c496f and following from 16.0, please include them in the correct point of the history.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chore: Thanks for squashing some of the administrative commits, I see there are still a few

Image

They have to be squashed too, according to https://github.com/OCA/maintainer-tools/wiki/Merge-commits-in-pull-requests#mergesquash-the-commits-generated-by-bots-or-weblate.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Thanks for updating the documentation! That's something most developers skip.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Maybe you'd like to include this video in the README? Otherwise please remove it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Maybe you'd like to include this video in the README? Otherwise please remove it.

class ResUsers(models.Model):
_inherit = "res.users"

default_company_ids = fields.Many2many(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: This is a new (welcome!) feature, would it be possible to implement it in its own [IMP] commit so it would be easier to backport?

}
}

this.companyService.setCompanies(selectedIds, false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: I'm not that expert as a frontend developer, but I see no super call in this function, would it be possible to add one so the inheritance chain is kept?
You could just set selectedCompaniesIds here and let super's call do the setCompanies, what do you think?

For reference, the function apply in super is https://github.com/odoo/odoo/blob/faa3c4bcabd523bbe5ea0221bcb95597ea004a69/addons/web/static/src/webclient/switch_company_menu/switch_company_menu.js#L51.

);
}, this.constructor.toggleDelay);
}
async confirm() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Same inheritance considerations of the apply override.

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.