diff options
| author | Romain Derie <rde@odoo.com> | 2019-03-18 16:46:59 +0000 |
|---|---|---|
| committer | Romain Derie <rde@odoo.com> | 2019-03-26 22:11:50 +0000 |
| commit | 98b20333d6271fd33d3061937170b770c03ceb70 (patch) | |
| tree | 01e31bb84845d278b78e802b43bc3b80f82daae4 /addons/web/static/src/js/views/basic/basic_controller.js | |
| parent | 3ccccd10af7b7b6fc6e591c0ddd569f7f575e1d8 (diff) | |
[IMP] website_sale: avoid misconfiguration in multi-website/multi-company
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 odoo/odoo#31929
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions
