diff --git a/golem_activity/models/golem_activity.py b/golem_activity/models/golem_activity.py index 777ce23..bafc8f1 100644 --- a/golem_activity/models/golem_activity.py +++ b/golem_activity/models/golem_activity.py @@ -24,6 +24,7 @@ class GolemActivity(models.Model): _inherit = 'mail.thread' name = fields.Char('Name', index=True, required=True) + default_code = fields.Char('Internal Reference', index=True) image = fields.Binary('Image', help='This field holds the image used as ' 'image for the activity.') note = fields.Text('Note') diff --git a/golem_activity/views/golem_activity_view.xml b/golem_activity/views/golem_activity_view.xml index ff3ee4f..bc6bbdf 100644 --- a/golem_activity/views/golem_activity_view.xml +++ b/golem_activity/views/golem_activity_view.xml @@ -36,6 +36,7 @@ along with this program. If not, see . + diff --git a/golem_activity_session/models/golem_activity_session.py b/golem_activity_session/models/golem_activity_session.py index 6e17a51..233eeb1 100644 --- a/golem_activity_session/models/golem_activity_session.py +++ b/golem_activity_session/models/golem_activity_session.py @@ -61,6 +61,7 @@ class GolemActivitySession(models.Model): _description = 'GOLEM Activities Sessions' _inherit = 'mail.thread' _inherits = {'product.template': 'product_id'} + _rec_name = 'session_name' product_id = fields.Many2one('product.template', required=True, ondelete='cascade') @@ -112,6 +113,8 @@ class GolemActivitySession(models.Model): for s in self: if not s.name: s.name = s.activity_id.name + if not s.default_code: + s.default_code = s.activity_id.default_code if not s.animator_id: s.animator_id = s.activity_id.animator_id @@ -160,8 +163,8 @@ class GolemActivitySession(models.Model): def onchange_hour_start(self): """ Sets end hour to start hour if no start hour """ for s in self: - if not s.hour_end: - s.hour_end = s.hour_start + if s.hour_start and not s.hour_end: + s.hour_end = s.hour_start + 1 @api.constrains('hour_start', 'hour_end') def _check_hour_period(self): @@ -215,5 +218,3 @@ class GolemActivitySession(models.Model): if v.is_overbooked and (v.places_overbooked <= v.places): emsg = _('Overbooked places cannot be inferior than places') raise models.ValidationError(emsg) - - note = fields.Text('Note') diff --git a/golem_activity_session/views/golem_activity_view.xml b/golem_activity_session/views/golem_activity_view.xml index 79a5b60..ee9fa48 100644 --- a/golem_activity_session/views/golem_activity_view.xml +++ b/golem_activity_session/views/golem_activity_view.xml @@ -72,7 +72,8 @@ along with this program. If not, see . - + @@ -90,9 +91,6 @@ along with this program. If not, see . - - -
@@ -123,6 +121,7 @@ along with this program. If not, see . +