[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>
This commit is contained in:
Odoo's Mergebot
2020-02-04 13:16:40 +01:00
committed by GitHub
3 changed files with 10 additions and 2 deletions
@@ -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;
@@ -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;
+1 -1
View File
@@ -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)