mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX] inherit duplicate_reservation
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from . import inherited_massive_changes
|
||||
from . import inherited_duplicate_reservation
|
||||
from . import inherited_massive_price_reservation_days
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo import models, api, _
|
||||
|
||||
|
||||
class MassiveChangesWizard(models.TransientModel):
|
||||
_inherit = 'hotel.wizard.duplicate.reservation'
|
||||
|
||||
@api.multi
|
||||
def duplicate_reservation(self):
|
||||
reservation_id = self.env['hotel.reservation'].browse(
|
||||
self.env.context.get('active_id'))
|
||||
if reservation_id and reservation_id.is_from_ota:
|
||||
raise ValidationError(_("Can't duplicate a reservation from channel"))
|
||||
return super(MassiveChangesWizard, self).duplicate_reservation()
|
||||
Reference in New Issue
Block a user