diff options
| author | Odoo's Mergebot <xmo+roboto@odoo.com> | 2020-06-22 16:46:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-22 16:46:29 +0200 |
| commit | 5a99aacda5b97e53f7df65323560586f6739b779 (patch) | |
| tree | 74095815cec90338d563e2be87f8736bf3dc4f20 /addons/web/static/src/js/views/basic/basic_controller.js | |
| parent | 669bba4694896e29c088d6ce69440d3bef8e9fe5 (diff) | |
| parent | 9389f7ce2ea16121a74535557fa4cae0577bb011 (diff) | |
[FW][MERGE] *: display sample data in empty views
This PR allows to display sample (fake) data in empty views, in
the hope of easing user onboarding. This can be enabled (in
list and kanban views) with attribute sample="1" on the arch
root element. In this case, if there is no data to display, sample
data will be generated based on heuristics (depending on field
types and names). This can be used in addition to the no
content helper.
This PR also activates it in a bunch of list and kanban views.
Task 2232801
closes odoo/odoo#53417
Forward-port-of: odoo/odoo#52867
Related: odoo/enterprise#11330
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Jérémy Hennecart <jeh@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_controller.js | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_controller.js b/addons/web/static/src/js/views/basic/basic_controller.js index 99da98f4301..ec7255b9e60 100644 --- a/addons/web/static/src/js/views/basic/basic_controller.js +++ b/addons/web/static/src/js/views/basic/basic_controller.js @@ -43,7 +43,6 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { this.hasButtons = params.hasButtons; FieldManagerMixin.init.call(this, this.model); this.mode = params.mode || 'readonly'; - this.handle = this.initialState.id; // savingDef is used to ensure that we always wait for pending save // operations to complete before checking if there are changes to // discard when discardChanges is called @@ -135,12 +134,6 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { return []; }, /** - * Gives the focus to the renderer - */ - giveFocus:function() { - this.renderer.giveFocus(); - }, - /** * Returns true iff the given recordID (or the main recordID) is dirty. * * @param {string} [recordID] - default to main recordID @@ -762,7 +755,7 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { await this.model.resequence(this.modelName, resIDs, this.handle, options); this._updateControlPanel(); state = this.model.get(this.handle); - return this.renderer.updateState(state, { noRender: true }); + return this._updateRendererState(state, { noRender: true }); }, }); }, |
