Add sequence ordering

This commit is contained in:
Youssef Elouahby 2018-11-02 11:52:34 +01:00
parent 482acded87
commit cc7ac21395
2 changed files with 3 additions and 0 deletions

View File

@ -24,6 +24,7 @@ from odoo.exceptions import ValidationError
class GolemActivityRegistrationSlot(models.Model):
""" GOLEM Activity Registration Slot """
_name = 'golem.activity.registration.slot'
_order = 'sequence'
_description = 'GOLEM Activity Registration Slot'
activity_id = fields.Many2one('golem.activity', required=True,
@ -33,6 +34,7 @@ class GolemActivityRegistrationSlot(models.Model):
ondelete='cascade', index=True)
hour_start = fields.Float('Start time')
hour_stop = fields.Float('Stop time')
sequence = fields.Integer('Sequence')
@api.constrains('hour_start', 'hour_stop')
def check_slot_hours(self):

View File

@ -37,6 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name='slots_duration' widget='float_time'/>
<field name='registration_slot_ids'>
<tree editable='bottom'>
<field name="sequence" widget="handle"/>
<field name="member_id"/>
<field name='hour_start' widget='float_time'/>
<field name='hour_stop' widget='float_time'/>