[FIX] channel_bind_ids in vals avoid

Sometime channel_bind_ids is coming in vals, avoid
This commit is contained in:
Darío Lodeiros
2019-05-12 14:16:38 +02:00
committed by GitHub
parent 5f74101c28
commit 497bfe0ec4

View File

@@ -188,7 +188,7 @@ class HotelReservation(models.Model):
@api.model
def create(self, vals):
from_channel = False
if 'channel_bind_ids' in vals and vals.get('channel_bind_ids')[0][2] and \
if vals.get('channel_bind_ids') and vals.get('channel_bind_ids')[0][2] and \
vals.get('channel_bind_ids')[0][2].get('external_id') is not None:
vals.update({'preconfirm': False})
from_channel = True