diff options
| author | Odoo's Mergebot <xmo+roboto@odoo.com> | 2020-02-04 13:16:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-04 13:16:40 +0100 |
| commit | d64bf7e6cd610a4431dedc4f230bc7b82d98bc24 (patch) | |
| tree | 3b9af3193b5c088000b57612684d51d64ce175a7 | |
| parent | 411dd85a80ac4aa93753465dc3cc96f74a8eb72b (diff) | |
| parent | c2fccc9118852460df52bf216785b13afcab42b5 (diff) | |
[MERGE] web_studio: model configurator
Improvements for custom models and some default behaviours
linked to the Studio model configurator (Enterprise task).
In a nutshell:
- mark the default `x_name` field of a custom model as 'to be copied'
- improvement for kanban views that makes it easier to user with
custom models
The interesting part is in the Enterprise `web_studio` module.
Task 2091654
Enterprise PR: odoo/enterprise#7326
closes odoo/odoo#42055
Related: odoo/enterprise#7326
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 3 | ||||
| -rw-r--r-- | addons/web/static/src/scss/kanban_view.scss | 7 | ||||
| -rw-r--r-- | odoo/addons/base/models/ir_model.py | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 996e759a70a..f2c44891ea2 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1875,7 +1875,8 @@ var FieldBinaryImage = AbstractFieldBinary.extend({ this.$el.addClass(this.attrs.class); } - var urlThumb = this._getImageUrl(this.model, this.res_id, 'image_128', unique); + const image_field = this.field.manual ? this.name:'image_128'; + var urlThumb = this._getImageUrl(this.model, this.res_id, image_field, unique); this.$el.empty(); $img = this.$el; diff --git a/addons/web/static/src/scss/kanban_view.scss b/addons/web/static/src/scss/kanban_view.scss index 84e52bda039..93605ab5640 100644 --- a/addons/web/static/src/scss/kanban_view.scss +++ b/addons/web/static/src/scss/kanban_view.scss @@ -58,6 +58,13 @@ width: $o-kanban-color-border-width; } + .o_kanban_record_details { + display: flex; + flex-direction: column; + justify-content: space-between; + width: 100%, + } + // Inner Sections .o_kanban_record_top, .o_kanban_record_body { margin-bottom: $o-kanban-inner-hmargin; diff --git a/odoo/addons/base/models/ir_model.py b/odoo/addons/base/models/ir_model.py index a33f80e9d9b..9c69d8057df 100644 --- a/odoo/addons/base/models/ir_model.py +++ b/odoo/addons/base/models/ir_model.py @@ -96,7 +96,7 @@ class IrModel(models.Model): def _default_field_id(self): if self.env.context.get('install_mode'): return [] # no default field when importing - return [(0, 0, {'name': 'x_name', 'field_description': 'Name', 'ttype': 'char'})] + return [(0, 0, {'name': 'x_name', 'field_description': 'Name', 'ttype': 'char', 'copied': True})] name = fields.Char(string='Model Description', translate=True, required=True) model = fields.Char(default='x_', required=True, index=True) |
