From 13344c402fb25cfe0b9f69946c91704214a6ec91 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 3 Mar 2016 16:23:14 +0100 Subject: [PATCH] Add sequence to images. --- base_multi_image/models/image.py | 3 +++ base_multi_image/views/image_view.xml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/base_multi_image/models/image.py b/base_multi_image/models/image.py index 45e906778..9a24cdf24 100644 --- a/base_multi_image/models/image.py +++ b/base_multi_image/models/image.py @@ -16,6 +16,7 @@ _logger = logging.getLogger(__name__) class Image(models.Model): _name = "base_multi_image.image" + _order = "sequence, owner_model, owner_id, id" _sql_constraints = [ ('uniq_name_owner', 'UNIQUE(owner_id, owner_model, name)', _('A document can have only one image with the same name.')), @@ -63,6 +64,8 @@ class Image(models.Model): comments = fields.Text( 'Comments', translate=True) + sequence = fields.Integer( + default=10) show_technical = fields.Boolean( compute="_show_technical") diff --git a/base_multi_image/views/image_view.xml b/base_multi_image/views/image_view.xml index dd4e31424..d6907a511 100644 --- a/base_multi_image/views/image_view.xml +++ b/base_multi_image/views/image_view.xml @@ -18,6 +18,7 @@ + @@ -72,6 +73,7 @@ + @@ -83,6 +85,7 @@ +