[FIX] event_type: allow to select typeless event

The requirement for somebody to choose a ticket product should be that it is an
event, not that it has an event type attached, mostly when `event_type_id` is
not a required field.

The event has been improved in upper version but as this field is only
informative, relaxing a bit the domain.

Closes #12475
This commit is contained in:
Jairo Llopis 2016-06-17 16:04:24 +02:00 committed by Martin Trigaux
parent 4227082869
commit 23ed2805b8
No known key found for this signature in database
GPG Key ID: 7B0E288E7C0F83A7
1 changed files with 2 additions and 1 deletions

View File

@ -205,7 +205,8 @@ class event_ticket(osv.osv):
_columns = {
'name': fields.char('Name', required=True, translate=True),
'event_id': fields.many2one('event.event', "Event", required=True, ondelete='cascade'),
'product_id': fields.many2one('product.product', 'Product', required=True, domain=[("event_type_id", "!=", False)]),
'product_id': fields.many2one('product.product', 'Product', required=True,
domain=["|", ("event_type_id", "!=", False), ("event_ok", "=", True)]),
'registration_ids': fields.one2many('event.registration', 'event_ticket_id', 'Registrations'),
'deadline': fields.date("Sales End"),
'is_expired': fields.function(_is_expired, type='boolean', string='Is Expired'),