-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMP] website_sale: avoid misconfiguration in multi-website/multi-company #31929
[IMP] website_sale: avoid misconfiguration in multi-website/multi-company #31929
Conversation
Wait forward-port of 28301 to remove part of diff for |
Your team can take it from there. Wait forward port so _default_website diff will be reduced |
84ac073
to
d9dbc94
Compare
…pany Before this commit, a pricelist could be easily misconfigured when multi-company and multi-website were both activated. Eg: website 2 is for company 1, create a pricelist and set website 2 and company 2, it would make no sense and code would not behave as expected. Now, we prevent this type of misconfiguration by ensuring a pricelist can't have a website which is from another company than the company set to the pricelist. We also filter website in m2o widget to only show company's websites. Closes odoo#25109 --------------- With this new constraint, l10n module would need to force company: l10n modules install will change the company currency, creating a pricelist for that currency. Do not use user's company in that case as module install are done with OdooBot (company 1). Step to reproduce: - Active multi-company and create a new company - Switch to that company and try to install any l10n module not in EUR or USD - It will create a new pricelist for that company for that new currency - It will crash as module install are done as OdooBot which is in company 1. It will search websites in OdooBot company (self.env.user). It will then create the pricelist with company 1's website which is uncompatible with the new company, thus raising the constraint.
d9dbc94
to
852ea39
Compare
Forward-port hit master. This PR got rebased and should be clean for review/merge. |
@robodoo r+ |
…pany Before this commit, a pricelist could be easily misconfigured when multi-company and multi-website were both activated. Eg: website 2 is for company 1, create a pricelist and set website 2 and company 2, it would make no sense and code would not behave as expected. Now, we prevent this type of misconfiguration by ensuring a pricelist can't have a website which is from another company than the company set to the pricelist. We also filter website in m2o widget to only show company's websites. Closes #25109 --------------- With this new constraint, l10n module would need to force company: l10n modules install will change the company currency, creating a pricelist for that currency. Do not use user's company in that case as module install are done with OdooBot (company 1). Step to reproduce: - Active multi-company and create a new company - Switch to that company and try to install any l10n module not in EUR or USD - It will create a new pricelist for that company for that new currency - It will crash as module install are done as OdooBot which is in company 1. It will search websites in OdooBot company (self.env.user). It will then create the pricelist with company 1's website which is uncompatible with the new company, thus raising the constraint. closes #31929 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Staging failed: ci/runbot on 7830439a9307b4b8735da57f22aed751eef28d87 (view more at http://runbot.odoo.com/runbot/build/488921) |
can you retry? |
@robodoo r+ |
@robodoo retry |
I'm sorry, @JKE-be. This PR is already reviewed, reviewing it again is useless. |
@robodoo be kind and retry plz |
…pany Before this commit, a pricelist could be easily misconfigured when multi-company and multi-website were both activated. Eg: website 2 is for company 1, create a pricelist and set website 2 and company 2, it would make no sense and code would not behave as expected. Now, we prevent this type of misconfiguration by ensuring a pricelist can't have a website which is from another company than the company set to the pricelist. We also filter website in m2o widget to only show company's websites. Closes #25109 --------------- With this new constraint, l10n module would need to force company: l10n modules install will change the company currency, creating a pricelist for that currency. Do not use user's company in that case as module install are done with OdooBot (company 1). Step to reproduce: - Active multi-company and create a new company - Switch to that company and try to install any l10n module not in EUR or USD - It will create a new pricelist for that company for that new currency - It will crash as module install are done as OdooBot which is in company 1. It will search websites in OdooBot company (self.env.user). It will then create the pricelist with company 1's website which is uncompatible with the new company, thus raising the constraint. closes #31929 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Merged, thanks! |
Before this commit, a pricelist could be easily misconfigured when
multi-company and multi-website were both activated.
Eg: website 2 is for company 1, create a pricelist and set website 2 and
company 2, it would make no sense and code would not behave as expected.
Now, we prevent this type of misconfiguration by ensuring a pricelist can't
have a website which is from another company than the company set to the
pricelist.
We also filter website in m2o widget to only show company's websites.
Closes #25109
With this new constraint, l10n module would need to force company:
l10n modules install will change the company currency, creating a pricelist for
that currency. Do not use user's company in that case as module install are
done with OdooBot (company 1).
Step to reproduce:
It will search websites in OdooBot company (self.env.user).
It will then create the pricelist with company 1's website which is
uncompatible with the new company, thus raising the constraint.