diff options
| author | Rémy Voet (ryv) <ryv@odoo.com> | 2020-04-14 12:13:54 +0000 |
|---|---|---|
| committer | Rémy Voet (ryv) <ryv@odoo.com> | 2020-05-25 08:50:02 +0000 |
| commit | 8414e6b9fde7bfcd0977fbb85464a73ab6f61a05 (patch) | |
| tree | 71f3550a4f7a25e598ba8b62ee222ff1f709825e /addons/stock/static | |
| parent | 82ca6b92c89a73a7a261decc10d0ea6ea8a573fa (diff) | |
[IMP] stock: handle multi-warehouse with the same logic of multi-company
Activate the multi-warehouse automatically when there is more than 1 in
a company. Then remove the multi-warehouse setting in the config, and
allow to create warehouse. Because create a warehouse can change
groups of the user, we reload the page when there is any modification.
Update warehouse demo data accordingly (remove the second warehouse
of the second company).
task-2196687
closes odoo/odoo#49625
Related: odoo/upgrade#1253
Related: odoo/enterprise#9934
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Diffstat (limited to 'addons/stock/static')
| -rw-r--r-- | addons/stock/static/src/js/basic_model.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/addons/stock/static/src/js/basic_model.js b/addons/stock/static/src/js/basic_model.js new file mode 100644 index 00000000000..6a5653c6314 --- /dev/null +++ b/addons/stock/static/src/js/basic_model.js @@ -0,0 +1,16 @@ +odoo.define('stock.BasicModel', function (require) { +"use strict"; + +var BasicModel = require('web.BasicModel'); +var localStorage = require('web.local_storage'); + +BasicModel.include({ + + _invalidateCache: function (dataPoint) { + this._super.apply(this, arguments); + if (dataPoint.model === 'stock.warehouse' && !localStorage.getItem('running_tour')) { + this.do_action('reload_context'); + } + } +}); +}); |
