OCA / multi-company

GNU Affero General Public License v3.0
101 stars 281 forks source link

[14.0][FIX] partner_multi_company: default value for res_partner.company_ids #575

Closed PicchiSeba closed 8 months ago

PicchiSeba commented 8 months ago

When company_ids is not set that means the contact will be available to all companies. This might create some noise and unwanted behavior.

A user assigned to only one company that creates a new contact without changing the company_ids field is going to make the contact available for anyone.

We can set the field to the current company in order to prevent this. If the user really wants to make the contact available to everyone they have to manually change the field.

Moreover the current module behavior goes against what's written in the USAGE file

On the partner form view, go to the "Sales & Purchases" tab, and put the companies in which you want to use that partner. If none is selected, the partner will be visible in all of them. The default value is the current one.

PicchiSeba commented 8 months ago

Updated the docs with the new option

PicchiSeba commented 8 months ago

I also added a test to address these changes

PicchiSeba commented 8 months ago

Ok, we should be good by now.

Let me know if you see any issue

francesco-ooops commented 8 months ago

@pedrobaeza in the end we went for the setting, in order to minimize disruption. Let us know if it's good for merge, thanks!

OCA-git-bot commented 8 months ago

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). 🤖

francesco-ooops commented 8 months ago

@pedrobaeza shall we merge?

pedrobaeza commented 8 months ago

/ocabot merge minor

OCA-git-bot commented 8 months ago

This PR looks fantastic, let's merge it! Prepared branch 14.0-ocabot-merge-pr-575-by-pedrobaeza-bump-minor, awaiting test results.

OCA-git-bot commented 8 months ago

Congratulations, your PR was merged at 732e0cf5f9de4d842fe246c44564156989d8ba57. Thanks a lot for contributing to OCA. ❤️