From 71f7fbded37bd6c5f00606ce3a198ed5f97bb292 Mon Sep 17 00:00:00 2001 From: Pablo Date: Fri, 26 Jul 2019 13:57:21 +0200 Subject: [PATCH] [UPD] Task 973 - raise error on delete --- .../models/hotel_room_type/deleter.py | 4 +++- .../models/hotel_room_type_restriction/deleter.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hotel_channel_connector_wubook/models/hotel_room_type/deleter.py b/hotel_channel_connector_wubook/models/hotel_room_type/deleter.py index fa49153e5..31460f4bf 100644 --- a/hotel_channel_connector_wubook/models/hotel_room_type/deleter.py +++ b/hotel_channel_connector_wubook/models/hotel_room_type/deleter.py @@ -3,7 +3,8 @@ from odoo.addons.component.core import Component from odoo.addons.hotel_channel_connector.components.core import ChannelConnectorError -from odoo import api +from odoo import api, _ +from odoo.exceptions import ValidationError class HotelRoomTypeDeleter(Component): @@ -18,3 +19,4 @@ class HotelRoomTypeDeleter(Component): section='room', internal_message=str(err), channel_message=err.data['message']) + raise ValidationError(_(err.data['message']) + ". " + _(str(err))) diff --git a/hotel_channel_connector_wubook/models/hotel_room_type_restriction/deleter.py b/hotel_channel_connector_wubook/models/hotel_room_type_restriction/deleter.py index 87b19d310..5f990a772 100644 --- a/hotel_channel_connector_wubook/models/hotel_room_type_restriction/deleter.py +++ b/hotel_channel_connector_wubook/models/hotel_room_type_restriction/deleter.py @@ -3,7 +3,8 @@ from odoo.addons.component.core import Component from odoo.addons.hotel_channel_connector.components.core import ChannelConnectorError -from odoo import api +from odoo import api, _ +from odoo.exceptions import ValidationError class HotelRoomTypeRestrictionDeleter(Component): @@ -18,3 +19,4 @@ class HotelRoomTypeRestrictionDeleter(Component): section='restriction', internal_message=str(err), channel_message=err.data['message']) + raise ValidationError(_(err.data['message']) + ". " + _(str(err)))