Browse Source

Add sequence to images.

pull/374/head
Jairo Llopis 9 years ago
parent
commit
13344c402f
  1. 3
      base_multi_image/models/image.py
  2. 3
      base_multi_image/views/image_view.xml

3
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")

3
base_multi_image/views/image_view.xml

@ -18,6 +18,7 @@
<field name="show_technical" invisible="True"/>
<field name="owner_model"/>
<field name="owner_id"/>
<field name="sequence"/>
</group>
<group string="Name">
<field name="name"/>
@ -72,6 +73,7 @@
<field name="storage"/>
<field name="owner_model"/>
<field name="owner_id"/>
<field name="sequence" invisible="True"/>
</tree>
</field>
</record>
@ -83,6 +85,7 @@
<kanban string="Product Images">
<field name="name"/>
<field name="storage"/>
<field name="sequence"/>
<templates>
<t t-name="kanban-box">
<div style="position: relative">

Loading…
Cancel
Save