From 23ed2805b89ba47657f50c689a97bf913e72f656 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 17 Jun 2016 16:04:24 +0200 Subject: [PATCH] [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 --- addons/event_sale/event_sale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/event_sale/event_sale.py b/addons/event_sale/event_sale.py index 15c35a4ba81..c89459f8471 100644 --- a/addons/event_sale/event_sale.py +++ b/addons/event_sale/event_sale.py @@ -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'),