diff --git a/call_center_report/wizard/call_center_report.py b/call_center_report/wizard/call_center_report.py
index cbc9729c9..114aee314 100644
--- a/call_center_report/wizard/call_center_report.py
+++ b/call_center_report/wizard/call_center_report.py
@@ -341,7 +341,6 @@ class CallCenterReportWizard(models.TransientModel):
'xls_binary': base64.encodestring(file_data.read()),
}
- @api.multi
def export(self):
self.write(self._export())
return {
diff --git a/call_center_report/wizard/call_center_report.xml b/call_center_report/wizard/call_center_report.xml
index 79439ea96..598a137d1 100644
--- a/call_center_report/wizard/call_center_report.xml
+++ b/call_center_report/wizard/call_center_report.xml
@@ -34,7 +34,6 @@
ir.actions.act_window
call.center.report.wizard
- form
form
new
diff --git a/cash_daily_report/data/menus.xml b/cash_daily_report/data/menus.xml
index 547d2ee13..ef93963a4 100644
--- a/cash_daily_report/data/menus.xml
+++ b/cash_daily_report/data/menus.xml
@@ -20,7 +20,6 @@
Internal Transfers
account.payment
- form
tree,kanban,form,graph
{'default_payment_type': 'transfer', 'search_default_transfers_filter': 1}
[]
diff --git a/cash_daily_report/wizard/cash_daily_report.py b/cash_daily_report/wizard/cash_daily_report.py
index 23662b940..b08382146 100644
--- a/cash_daily_report/wizard/cash_daily_report.py
+++ b/cash_daily_report/wizard/cash_daily_report.py
@@ -299,7 +299,7 @@ class CashDailyReportWizard(models.TransientModel):
'xls_binary': base64.encodestring(file_data.read()),
}
- @api.multi
+
def export(self):
self.write(self._export())
return {
diff --git a/cash_daily_report/wizard/cash_daily_report.xml b/cash_daily_report/wizard/cash_daily_report.xml
index 37487a94c..caab7f860 100644
--- a/cash_daily_report/wizard/cash_daily_report.xml
+++ b/cash_daily_report/wizard/cash_daily_report.xml
@@ -34,7 +34,6 @@
ir.actions.act_window
cash.daily.report.wizard
- form
form
new
diff --git a/glasof_exporter/wizard/glasof_wizard.py b/glasof_exporter/wizard/glasof_wizard.py
index 9bf047d3f..4a2b386b2 100644
--- a/glasof_exporter/wizard/glasof_wizard.py
+++ b/glasof_exporter/wizard/glasof_wizard.py
@@ -242,7 +242,7 @@ class GlassofExporterWizard(models.TransientModel):
'xls_invoices_binary': base64.encodestring(file_data.read()),
}
- @api.multi
+
def export(self):
towrite = {}
if self.export_journals:
diff --git a/glasof_exporter/wizard/glasof_wizard.xml b/glasof_exporter/wizard/glasof_wizard.xml
index 0ea1c4f53..4b0939968 100644
--- a/glasof_exporter/wizard/glasof_wizard.xml
+++ b/glasof_exporter/wizard/glasof_wizard.xml
@@ -45,7 +45,6 @@
ir.actions.act_window
glasof.exporter.wizard
- form
form
new
diff --git a/hotel_calendar/data/menus.xml b/hotel_calendar/data/menus.xml
index 9b66e8e9c..9860b6d56 100644
--- a/hotel_calendar/data/menus.xml
+++ b/hotel_calendar/data/menus.xml
@@ -5,7 +5,6 @@
Hotel Calendar
hotel.reservation
pms
- form
diff --git a/hotel_calendar/models/hotel_calendar_management.py b/hotel_calendar/models/hotel_calendar_management.py
index 7d4379a81..afa137340 100644
--- a/hotel_calendar/models/hotel_calendar_management.py
+++ b/hotel_calendar/models/hotel_calendar_management.py
@@ -14,7 +14,7 @@ class HotelCalendarManagement(models.TransientModel):
_name = 'hotel.calendar.management'
# Business methods
- @api.multi
+
def get_hcalendar_settings(self):
return {
'eday_week': self.env.user.hotel_id.pms_end_day_week,
diff --git a/hotel_calendar/models/inherited_hotel_folio.py b/hotel_calendar/models/inherited_hotel_folio.py
index 1589e9095..01929f3de 100644
--- a/hotel_calendar/models/inherited_hotel_folio.py
+++ b/hotel_calendar/models/inherited_hotel_folio.py
@@ -7,7 +7,7 @@ class HotelFolio(models.Model):
_inherit = 'hotel.folio'
# ORM overrides
- @api.multi
+
def write(self, vals):
ret = super(HotelFolio, self).write(vals)
fields_to_check = ('reservation_ids', 'service_ids', 'pending_amount')
@@ -17,7 +17,7 @@ class HotelFolio(models.Model):
record.reservation_ids.send_bus_notification('write', 'noshow')
return ret
- @api.multi
+
def unlink(self):
for record in self:
record.reservation_ids.send_bus_notification('unlink', 'warn',
@@ -25,7 +25,7 @@ class HotelFolio(models.Model):
return super(HotelFolio, self).unlink()
# Business methods
- @api.multi
+
def compute_amount(self):
ret = super(HotelFolio, self).compute_amount()
with self.env.norecompute():
diff --git a/hotel_calendar/models/inherited_hotel_reservation.py b/hotel_calendar/models/inherited_hotel_reservation.py
index 22fb3be30..ba48b1b99 100644
--- a/hotel_calendar/models/inherited_hotel_reservation.py
+++ b/hotel_calendar/models/inherited_hotel_reservation.py
@@ -19,7 +19,7 @@ class HotelReservation(models.Model):
store=True)
# TODO: Add the following method into _compute_color
- @api.multi
+
def _generate_color(self):
self.ensure_one()
company_id = self.env.user.company_id
@@ -77,14 +77,14 @@ class HotelReservation(models.Model):
_("Reservation Created"))
return reservation_id
- @api.multi
+
def write(self, vals):
_logger.info("RESERV WRITE")
ret = super(HotelReservation, self).write(vals)
self.send_bus_notification('write', 'noshow')
return ret
- @api.multi
+
def unlink(self):
self.send_bus_notification('unlink',
'warn',
@@ -429,7 +429,7 @@ class HotelReservation(models.Model):
'show_num_rooms': self.env.user.hotel_id.pms_show_num_rooms,
}
- @api.multi
+
def generate_bus_values(self, naction, ntype, ntitle=''):
self.ensure_one()
return {
@@ -475,7 +475,7 @@ class HotelReservation(models.Model):
if service.product_id.show_in_calendar] or False,
}
- @api.multi
+
def send_bus_notification(self, naction, ntype, ntitle=''):
hotel_cal_obj = self.env['bus.hotel.calendar']
for record in self:
diff --git a/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py b/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py
index d8f4e6e60..d24cc7b5c 100644
--- a/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py
+++ b/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py
@@ -28,7 +28,7 @@ class HotelRoomTypeRestrictionItem(models.Model):
})
return res
- @api.multi
+
def write(self, vals):
ret_vals = super(HotelRoomTypeRestrictionItem, self).write(vals)
bus_hotel_calendar_obj = self.env['bus.hotel.calendar']
@@ -48,7 +48,7 @@ class HotelRoomTypeRestrictionItem(models.Model):
})
return ret_vals
- @api.multi
+
def unlink(self):
default_restriction_id = self.env.user.hotel_id.default_restriction_id.id
# Construct dictionary with relevant info of removed records
diff --git a/hotel_calendar/models/inherited_product_pricelist_item.py b/hotel_calendar/models/inherited_product_pricelist_item.py
index ec5721b13..e55cb0cb8 100644
--- a/hotel_calendar/models/inherited_product_pricelist_item.py
+++ b/hotel_calendar/models/inherited_product_pricelist_item.py
@@ -37,7 +37,7 @@ class ProductPricelistItem(models.Model):
})
return res
- @api.multi
+
def write(self, vals):
# TODO: refactoring res.config.settings', 'default_pricelist_id' by the current hotel.property.pricelist_id
pricelist_default_id = self.env['ir.default'].sudo().get(
@@ -77,7 +77,7 @@ class ProductPricelistItem(models.Model):
})
return ret_vals
- @api.multi
+
def unlink(self):
# TODO: refactoring res.config.settings', 'default_pricelist_id' by the current hotel.property.pricelist_id
pricelist_default_id = self.env['ir.default'].sudo().get(
diff --git a/hotel_calendar/views/actions.xml b/hotel_calendar/views/actions.xml
index 252660f09..9bdf06417 100644
--- a/hotel_calendar/views/actions.xml
+++ b/hotel_calendar/views/actions.xml
@@ -4,7 +4,6 @@
Hotel folio checkin
hotel.reservation
- form
tree,form
[('real_checkin','=', datetime.datetime.now().strftime('%Y-%m-%d')),
('state', 'in', ['confirm']),
@@ -14,7 +13,6 @@
Hotel folio checkout
hotel.reservation
- form
tree,form
[('real_checkout','=', datetime.datetime.now().strftime('%Y-%m-%d')),
('state', 'in', ['booking']),
@@ -24,7 +22,6 @@
Hotel Calendar
hotel.calendar
- form
tree,form
diff --git a/hotel_calendar_channel_connector/models/inherited_hotel_calendar_management.py b/hotel_calendar_channel_connector/models/inherited_hotel_calendar_management.py
index 7f830b21f..b447e5a23 100644
--- a/hotel_calendar_channel_connector/models/inherited_hotel_calendar_management.py
+++ b/hotel_calendar_channel_connector/models/inherited_hotel_calendar_management.py
@@ -60,7 +60,7 @@ class HotelCalendarManagement(models.TransientModel):
}
return vals
- @api.multi
+
def save_changes(self, pricelist_id, restriction_id, pricelist,
restrictions, availability={}):
res = super(HotelCalendarManagement, self).save_changes(
diff --git a/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py b/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py
index a3a15a726..1b2ca9477 100644
--- a/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py
+++ b/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py
@@ -8,7 +8,7 @@ _logger = logging.getLogger(__name__)
class HotelReservation(models.Model):
_inherit = "hotel.reservation"
- @api.multi
+
def _hcalendar_reservation_data(self, reservations):
vals = super(HotelReservation, self)._hcalendar_reservation_data(reservations)
# TODO: Improve performance by doing a SQL as in get_hcalendar_reservations_data()
@@ -35,7 +35,7 @@ class HotelReservation(models.Model):
# REVIEW: What happens if the reservation is splitted and no parent with channel_bind_ids ¿?
return vals
- @api.multi
+
def generate_bus_values(self, naction, ntype, ntitle=''):
self.ensure_one()
vals = super(HotelReservation, self).generate_bus_values(naction, ntype, ntitle)
@@ -50,7 +50,7 @@ class HotelReservation(models.Model):
})
return vals
- @api.multi
+
def confirm(self):
for record in self:
if record.to_assign:
diff --git a/hotel_calendar_channel_connector/models/inherited_hotel_room_type_availability.py b/hotel_calendar_channel_connector/models/inherited_hotel_room_type_availability.py
index d9a5492ed..247cf6b78 100644
--- a/hotel_calendar_channel_connector/models/inherited_hotel_room_type_availability.py
+++ b/hotel_calendar_channel_connector/models/inherited_hotel_room_type_availability.py
@@ -25,7 +25,7 @@ class HotelRoomTypeAvailability(models.Model):
)
return res
- @api.multi
+
def write(self, vals):
ret_vals = super(HotelRoomTypeAvailability, self).write(vals)
bus_hotel_calendar_obj = self.env['bus.hotel.calendar']
@@ -35,7 +35,7 @@ class HotelRoomTypeAvailability(models.Model):
)
return ret_vals
- @api.multi
+
def unlink(self):
# Construct dictionary with relevant info of removed records
unlink_vals = []
diff --git a/hotel_channel_connector/models/channel_backend/common.py b/hotel_channel_connector/models/channel_backend/common.py
index 6440c087c..6055fd642 100644
--- a/hotel_channel_connector/models/channel_backend/common.py
+++ b/hotel_channel_connector/models/channel_backend/common.py
@@ -53,12 +53,12 @@ class ChannelBackend(models.Model):
'backend_id',
string="OTA's")
- @api.multi
+
def generate_key(self):
for record in self:
record.security_token = binascii.hexlify(os.urandom(16)).decode()
- @api.multi
+
def synchronize_push_urls(self):
base_url = self.env['ir.config_parameter'].get_param('web.base.url')
base_url = base_url.replace("http://", "https://")
@@ -66,7 +66,7 @@ class ChannelBackend(models.Model):
for record in self:
channel_ota_info_obj.push_activation(record, base_url)
- @api.multi
+
def import_reservations(self):
channel_hotel_reservation_obj = self.env['channel.hotel.reservation']
for backend in self:
@@ -80,7 +80,7 @@ class ChannelBackend(models.Model):
title="Import Reservations")
return True
- @api.multi
+
def import_reservations_range(self):
channel_hotel_reservation_obj = self.env['channel.hotel.reservation']
for backend in self:
@@ -97,7 +97,7 @@ class ChannelBackend(models.Model):
title="Import Reservations")
return True
- @api.multi
+
def import_reservation(self):
channel_hotel_reservation_obj = self.env['channel.hotel.reservation']
for backend in self:
@@ -110,7 +110,7 @@ class ChannelBackend(models.Model):
title="Import Reservations")
return True
- @api.multi
+
def import_rooms(self):
channel_hotel_room_type_obj = self.env['channel.hotel.room.type']
for backend in self:
@@ -124,7 +124,7 @@ class ChannelBackend(models.Model):
title="Import Rooms")
return True
- @api.multi
+
def import_otas_info(self):
channel_ota_info_obj = self.env['channel.ota.info']
for backend in self:
@@ -134,7 +134,7 @@ class ChannelBackend(models.Model):
title="Import OTA's")
return True
- @api.multi
+
def import_availability(self):
channel_hotel_room_type_avail_obj = self.env['channel.hotel.room.type.availability']
for backend in self:
@@ -147,7 +147,7 @@ class ChannelBackend(models.Model):
title="Import Availability")
return True
- @api.multi
+
def push_availability(self):
channel_hotel_room_type_avail_obj = self.env['channel.hotel.room.type.availability']
for backend in self:
@@ -157,7 +157,7 @@ class ChannelBackend(models.Model):
title="Export Availability")
return True
- @api.multi
+
def import_restriction_plans(self):
channel_hotel_room_type_restr_obj = self.env['channel.hotel.room.type.restriction']
for backend in self:
@@ -171,7 +171,7 @@ class ChannelBackend(models.Model):
title="Import Restrictions")
return True
- @api.multi
+
def import_restriction_values(self):
channel_hotel_restr_item_obj = self.env['channel.hotel.room.type.restriction.item']
for backend in self:
@@ -185,7 +185,7 @@ class ChannelBackend(models.Model):
title="Import Restrictions")
return True
- @api.multi
+
def push_restriction(self):
channel_hotel_restr_item_obj = self.env['channel.hotel.room.type.restriction.item']
for backend in self:
@@ -195,7 +195,7 @@ class ChannelBackend(models.Model):
title="Export Restrictions")
return True
- @api.multi
+
def import_pricelist_plans(self):
channel_product_pricelist_obj = self.env['channel.product.pricelist']
for backend in self:
@@ -209,7 +209,7 @@ class ChannelBackend(models.Model):
title="Import Pricelists")
return True
- @api.multi
+
def import_pricelist_values(self):
channel_product_pricelist_item_obj = self.env['channel.product.pricelist.item']
for backend in self:
@@ -223,7 +223,7 @@ class ChannelBackend(models.Model):
title="Import Pricelists")
return True
- @api.multi
+
def push_pricelist(self):
channel_product_pricelist_item_obj = self.env['channel.product.pricelist.item']
for backend in self:
@@ -233,7 +233,7 @@ class ChannelBackend(models.Model):
title="Export Pricelists")
return True
- @api.multi
+
def close_online_sales(self):
channel_hotel_restr_item_obj = self.env['channel.hotel.room.type.restriction.item']
for backend in self:
@@ -243,7 +243,7 @@ class ChannelBackend(models.Model):
title="Export Restrictions")
return True
- @api.multi
+
def channel_availability_watchdog(self):
# search all availability to the future TODO: It not prepared for multiple backends
availabilities = self.env['hotel.room.type.availability'].search([
diff --git a/hotel_channel_connector/models/hotel_channel_connector_issue.py b/hotel_channel_connector/models/hotel_channel_connector_issue.py
index 278e6d81a..aada31150 100644
--- a/hotel_channel_connector/models/hotel_channel_connector_issue.py
+++ b/hotel_channel_connector/models/hotel_channel_connector_issue.py
@@ -37,17 +37,17 @@ class HotelChannelConnectorIssue(models.Model):
title=_("Oops! %s Issue Reported!!") % issue_id.section)
return issue_id
- @api.multi
+
def mark_readed(self):
for record in self:
record.to_read = False
- @api.multi
+
def toggle_to_read(self):
for record in self:
record.to_read = not record.to_read
- @api.multi
+
def mark_as_read(self):
reserv_ids = []
for record in self:
diff --git a/hotel_channel_connector/models/hotel_reservation/common.py b/hotel_channel_connector/models/hotel_reservation/common.py
index ce70a4017..b1515f793 100644
--- a/hotel_channel_connector/models/hotel_reservation/common.py
+++ b/hotel_channel_connector/models/hotel_reservation/common.py
@@ -72,20 +72,20 @@ class ChannelHotelReservation(models.Model):
return importer.fetch_bookings(dfrom, dto)
@job(default_channel='root.channel')
- @api.multi
+
def cancel_reservation(self):
with self.backend_id.work_on(self._name) as work:
exporter = work.component(usage='hotel.reservation.exporter')
return exporter.cancel_reservation(self)
@job(default_channel='root.channel')
- @api.multi
+
def mark_booking(self):
with self.backend_id.work_on(self._name) as work:
exporter = work.component(usage='hotel.reservation.exporter')
return exporter.mark_booking(self)
- @api.multi
+
def unlink(self):
vals = []
for record in self:
@@ -116,7 +116,7 @@ class ChannelHotelReservation(models.Model):
class HotelReservation(models.Model):
_inherit = 'hotel.reservation'
- @api.multi
+
def _set_access_for_channel_fields(self):
for record in self:
user = self.env['res.users'].browse(self.env.uid)
@@ -215,7 +215,7 @@ class HotelReservation(models.Model):
return reservation_id
- @api.multi
+
def write(self, vals):
if self._context.get('connector_no_export', True) and \
(vals.get('checkin') or vals.get('checkout') or
@@ -267,7 +267,7 @@ class HotelReservation(models.Model):
res = super().write(vals)
return res
- @api.multi
+
def generate_copy_values(self, checkin=False, checkout=False):
self.ensure_one()
res = super().generate_copy_values(checkin=checkin, checkout=checkout)
@@ -282,7 +282,7 @@ class HotelReservation(models.Model):
})
return res
- @api.multi
+
def action_reservation_checkout(self):
for record in self:
if record.state != 'cancelled':
@@ -299,7 +299,7 @@ class HotelReservation(models.Model):
return (json_reservs, json_tooltips)
- @api.multi
+
def mark_as_readed(self):
self.write({'to_assign': False})
diff --git a/hotel_channel_connector/models/hotel_room_type/common.py b/hotel_channel_connector/models/hotel_room_type/common.py
index 2b70f9676..616bc0981 100644
--- a/hotel_channel_connector/models/hotel_room_type/common.py
+++ b/hotel_channel_connector/models/hotel_room_type/common.py
@@ -87,7 +87,7 @@ class ChannelHotelRoomType(models.Model):
raise ValidationError(_("OTA's capacity can't be greater than room type capacity"))
- @api.multi
+
@api.constrains('channel_short_code')
def _check_channel_short_code(self):
for record in self:
@@ -95,7 +95,7 @@ class ChannelHotelRoomType(models.Model):
raise ValidationError(_("Chanel short code can't be longer than 4 characters"))
@job(default_channel='root.channel')
- @api.multi
+
def create_room(self):
self.ensure_one()
if not self.external_id:
@@ -104,7 +104,7 @@ class ChannelHotelRoomType(models.Model):
exporter.create_room(self)
@job(default_channel='root.channel')
- @api.multi
+
def modify_room(self):
self.ensure_one()
if self.external_id:
@@ -113,7 +113,7 @@ class ChannelHotelRoomType(models.Model):
exporter.modify_room(self)
@job(default_channel='root.channel')
- @api.multi
+
def delete_room(self):
self.ensure_one()
if self.external_id:
@@ -145,7 +145,7 @@ class HotelRoomType(models.Model):
_("You can not archive a room type with active rooms.") + " " +
_("Please, change the %s room(s) to other room type.") % str(record.total_rooms_count))
- @api.multi
+
def get_restrictions(self, date, restriction_plan_id):
self.ensure_one()
restriction = self.env['hotel.room.type.restriction.item'].search([
@@ -155,7 +155,7 @@ class HotelRoomType(models.Model):
], limit=1)
return restriction
- @api.multi
+
def open_channel_bind_ids(self):
channel_bind_ids = self.mapped('channel_bind_ids')
action = self.env.ref('hotel_channel_connector.channel_hotel_room_type_action').read()[0]
@@ -176,12 +176,12 @@ class HotelRoomType(models.Model):
'default_total_rooms_count': self.total_rooms_count}
return action
- @api.multi
+
def disconnect_channel_bind_ids(self):
# TODO: multichannel rooms is not implemented
self.channel_bind_ids.with_context({'connector_no_export': True}).unlink()
- @api.multi
+
def write(self, vals):
if 'active' in vals and vals.get('active') is False:
self.channel_bind_ids.unlink()
diff --git a/hotel_channel_connector/models/hotel_room_type_restriction/common.py b/hotel_channel_connector/models/hotel_room_type_restriction/common.py
index c8d902198..7394a5a2d 100644
--- a/hotel_channel_connector/models/hotel_room_type_restriction/common.py
+++ b/hotel_channel_connector/models/hotel_room_type_restriction/common.py
@@ -20,7 +20,7 @@ class ChannelHotelRoomTypeRestriction(models.Model):
ondelete='cascade')
@job(default_channel='root.channel')
- @api.multi
+
def create_plan(self):
self.ensure_one()
if not self.external_id:
@@ -29,7 +29,7 @@ class ChannelHotelRoomTypeRestriction(models.Model):
exporter.create_rplan(self)
@job(default_channel='root.channel')
- @api.multi
+
def update_plan_name(self):
self.ensure_one()
if self.external_id:
@@ -38,7 +38,7 @@ class ChannelHotelRoomTypeRestriction(models.Model):
exporter.rename_rplan(self)
@job(default_channel='root.channel')
- @api.multi
+
def delete_plan(self):
self.ensure_one()
if self.external_id:
@@ -62,7 +62,7 @@ class HotelRoomTypeRestriction(models.Model):
inverse_name='odoo_id',
string='Hotel Channel Connector Bindings')
- @api.multi
+
@api.depends('name')
def name_get(self):
room_type_restriction_obj = self.env['hotel.room.type.restriction']
@@ -80,7 +80,7 @@ class HotelRoomTypeRestriction(models.Model):
names.append((name[0], name[1]))
return names
- @api.multi
+
def open_channel_bind_ids(self):
channel_bind_ids = self.mapped('channel_bind_ids')
action = self.env.ref('hotel_channel_connector.channel_hotel_room_type_restriction_action').read()[0]
@@ -98,12 +98,12 @@ class HotelRoomTypeRestriction(models.Model):
}
return action
- @api.multi
+
def disconnect_channel_bind_ids(self):
# TODO: multichannel rooms is not implemented
self.channel_bind_ids.with_context({'connector_no_export': True}).unlink()
- @api.multi
+
def write(self, vals):
if 'active' in vals and vals.get('active') is False:
self.channel_bind_ids.unlink()
diff --git a/hotel_channel_connector/models/inherited_hotel_folio.py b/hotel_channel_connector/models/inherited_hotel_folio.py
index f31cf5220..bdb8b724b 100644
--- a/hotel_channel_connector/models/inherited_hotel_folio.py
+++ b/hotel_channel_connector/models/inherited_hotel_folio.py
@@ -28,7 +28,7 @@ class HotelFolio(models.Model):
importer = work.component(usage='channel.importer')
importer.fetch_new_bookings()
- @api.multi
+
def action_confirm(self):
for rec in self:
rec.reservation_ids.write({
@@ -36,7 +36,7 @@ class HotelFolio(models.Model):
})
return super().action_confirm()
- @api.multi
+
def get_grouped_reservations_json(self, state, import_all=False):
super().get_grouped_reservations_json(state, import_all=import_all)
self.ensure_one()
diff --git a/hotel_channel_connector/models/inherited_hotel_room.py b/hotel_channel_connector/models/inherited_hotel_room.py
index b297cba99..c8bf9da3c 100644
--- a/hotel_channel_connector/models/inherited_hotel_room.py
+++ b/hotel_channel_connector/models/inherited_hotel_room.py
@@ -9,7 +9,7 @@ from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
class HotelRoom(models.Model):
_inherit = 'hotel.room'
- @api.multi
+
def write(self, vals):
"""
Update default availability for segmentation management
diff --git a/hotel_channel_connector/models/inherited_hotel_room_type_class.py b/hotel_channel_connector/models/inherited_hotel_room_type_class.py
index fb04c4f7c..e742f31a0 100644
--- a/hotel_channel_connector/models/inherited_hotel_room_type_class.py
+++ b/hotel_channel_connector/models/inherited_hotel_room_type_class.py
@@ -10,14 +10,14 @@ class HotelRoomTypeClass(models.Model):
_locked_codes = []
- @api.multi
+
def write(self, vals):
for record in self:
if record.code_class in self._locked_codes:
raise ValidationError(_("Can't modify channel room type class"))
return super(HotelRoomTypeClass, self).write(vals)
- @api.multi
+
def unlink(self):
for record in self:
if record.code_class in self._locked_codes:
diff --git a/hotel_channel_connector/models/product_pricelist/common.py b/hotel_channel_connector/models/product_pricelist/common.py
index 995672a20..6c49dda32 100644
--- a/hotel_channel_connector/models/product_pricelist/common.py
+++ b/hotel_channel_connector/models/product_pricelist/common.py
@@ -22,7 +22,7 @@ class ChannelProductPricelist(models.Model):
ondelete='cascade')
@job(default_channel='root.channel')
- @api.multi
+
def create_plan(self):
self.ensure_one()
if not self.external_id:
@@ -31,7 +31,7 @@ class ChannelProductPricelist(models.Model):
exporter.create_plan(self)
@job(default_channel='root.channel')
- @api.multi
+
def create_vplan(self):
self.ensure_one()
if not self.external_id:
@@ -40,7 +40,7 @@ class ChannelProductPricelist(models.Model):
exporter.create_vplan(self)
@job(default_channel='root.channel')
- @api.multi
+
def modify_vplan(self):
self.ensure_one()
if self.external_id:
@@ -49,7 +49,7 @@ class ChannelProductPricelist(models.Model):
exporter.modify_vplan(self)
@job(default_channel='root.channel')
- @api.multi
+
def update_plan_name(self):
self.ensure_one()
if self.external_id:
@@ -58,7 +58,7 @@ class ChannelProductPricelist(models.Model):
exporter.update_plan_name(self)
@job(default_channel='root.channel')
- @api.multi
+
def delete_plan(self):
self.ensure_one()
if self.external_id:
@@ -103,7 +103,7 @@ class ProductPricelist(models.Model):
for item in record.item_ids):
record.is_virtual_plan = False
- @api.multi
+
@api.depends('name')
def name_get(self):
pricelist_obj = self.env['product.pricelist']
@@ -121,7 +121,7 @@ class ProductPricelist(models.Model):
names.append((name[0], name[1]))
return names
- @api.multi
+
def open_channel_bind_ids(self):
channel_bind_ids = self.mapped('channel_bind_ids')
action = self.env.ref('hotel_channel_connector.channel_product_pricelist_action').read()[0]
@@ -140,12 +140,12 @@ class ProductPricelist(models.Model):
}
return action
- @api.multi
+
def disconnect_channel_bind_ids(self):
# TODO: multichannel rooms is not implemented
self.channel_bind_ids.with_context({'connector_no_export': True}).unlink()
- @api.multi
+
def write(self, vals):
if 'active' in vals and vals.get('active') is False:
self.channel_bind_ids.unlink()
diff --git a/hotel_channel_connector/tests/common.py b/hotel_channel_connector/tests/common.py
index 336c2fd69..7369e77aa 100644
--- a/hotel_channel_connector/tests/common.py
+++ b/hotel_channel_connector/tests/common.py
@@ -40,7 +40,7 @@ class TestHotelWubook(TestHotel):
def _init_mock_hotel(cls):
super(TestHotelWubook, cls)._init_mock_hotel()
- @api.multi
+
def wubook_ommit(self, *args, **kwargs):
return True
diff --git a/hotel_channel_connector/views/channel_connector_backend_views.xml b/hotel_channel_connector/views/channel_connector_backend_views.xml
index a49ee5db2..b58c09405 100644
--- a/hotel_channel_connector/views/channel_connector_backend_views.xml
+++ b/hotel_channel_connector/views/channel_connector_backend_views.xml
@@ -205,7 +205,6 @@
Hotel Channel Backends
channel.backend
- form
tree,form
diff --git a/hotel_channel_connector/views/channel_hotel_room_type_restriction_views.xml b/hotel_channel_connector/views/channel_hotel_room_type_restriction_views.xml
index 63ed64a71..b468bce5e 100644
--- a/hotel_channel_connector/views/channel_hotel_room_type_restriction_views.xml
+++ b/hotel_channel_connector/views/channel_hotel_room_type_restriction_views.xml
@@ -30,9 +30,7 @@
Hotel Channel Connector Bindings
channel.hotel.room.type.restriction
- form
tree,form
- form
[]
diff --git a/hotel_channel_connector/views/channel_hotel_room_type_views.xml b/hotel_channel_connector/views/channel_hotel_room_type_views.xml
index 6251566c9..af7fe19ac 100644
--- a/hotel_channel_connector/views/channel_hotel_room_type_views.xml
+++ b/hotel_channel_connector/views/channel_hotel_room_type_views.xml
@@ -63,9 +63,7 @@
Hotel Channel Connector Bindings
channel.hotel.room.type
- form
tree,form
- form
[]
diff --git a/hotel_channel_connector/views/channel_product_pricelist_views.xml b/hotel_channel_connector/views/channel_product_pricelist_views.xml
index 5c836ac70..b0ae78574 100644
--- a/hotel_channel_connector/views/channel_product_pricelist_views.xml
+++ b/hotel_channel_connector/views/channel_product_pricelist_views.xml
@@ -32,9 +32,7 @@
Hotel Channel Connector Bindings
channel.product.pricelist
- form
tree,form
- form
[]
diff --git a/hotel_channel_connector/views/hotel_channel_connector_issue_views.xml b/hotel_channel_connector/views/hotel_channel_connector_issue_views.xml
index 10e854da5..0ed44f164 100644
--- a/hotel_channel_connector/views/hotel_channel_connector_issue_views.xml
+++ b/hotel_channel_connector/views/hotel_channel_connector_issue_views.xml
@@ -77,7 +77,6 @@
Hotel Channel Connector Issues
hotel.channel.connector.issue
- form
tree,form
{"search_default_to_read":True}
diff --git a/hotel_channel_connector/views/hotel_room_type_availability_views.xml b/hotel_channel_connector/views/hotel_room_type_availability_views.xml
index 05d8f3648..b7ac713cc 100644
--- a/hotel_channel_connector/views/hotel_room_type_availability_views.xml
+++ b/hotel_channel_connector/views/hotel_room_type_availability_views.xml
@@ -56,7 +56,6 @@
Room Type Availability
hotel.room.type.availability
- form
tree,form
diff --git a/hotel_channel_connector/wizard/inherited_massive_changes.py b/hotel_channel_connector/wizard/inherited_massive_changes.py
index 7b7597685..728e7a196 100644
--- a/hotel_channel_connector/wizard/inherited_massive_changes.py
+++ b/hotel_channel_connector/wizard/inherited_massive_changes.py
@@ -63,13 +63,13 @@ class MassiveChangesWizard(models.TransientModel):
'mail_create_nosubscribe': True,
}).create(vals)
- @api.multi
+
def massive_change(self):
res = super(MassiveChangesWizard, self).massive_change()
self.env['channel.backend'].cron_push_changes()
return res
- @api.multi
+
def massive_change_close(self):
res = super(MassiveChangesWizard, self).massive_change_close()
self.env['channel.backend'].cron_push_changes()
diff --git a/hotel_channel_connector/wizard/inherited_massive_price_reservation_days.py b/hotel_channel_connector/wizard/inherited_massive_price_reservation_days.py
index f85915090..203f7e4a0 100644
--- a/hotel_channel_connector/wizard/inherited_massive_price_reservation_days.py
+++ b/hotel_channel_connector/wizard/inherited_massive_price_reservation_days.py
@@ -7,7 +7,7 @@ from odoo import models, api, _
class MassivePriceChangeWizard(models.TransientModel):
_inherit = 'hotel.wizard.massive.price.reservation.days'
- @api.multi
+
def massive_price_change_days(self):
self.ensure_one()
hotel_reservation_obj = self.env['hotel.reservation']
diff --git a/hotel_channel_connector_wubook/models/channel_backend/common.py b/hotel_channel_connector_wubook/models/channel_backend/common.py
index 5b11e8c77..ac830a249 100644
--- a/hotel_channel_connector_wubook/models/channel_backend/common.py
+++ b/hotel_channel_connector_wubook/models/channel_backend/common.py
@@ -35,7 +35,7 @@ class ChannelBackend(models.Model):
default=_get_default_wubook_parity)
@contextmanager
- @api.multi
+
def work_on(self, model_name, **kwargs):
self.ensure_one()
wubook_login = WuBookLogin(
diff --git a/hotel_channel_connector_wubook/models/hotel_reservation/common.py b/hotel_channel_connector_wubook/models/hotel_reservation/common.py
index fd41275c1..2b5072963 100644
--- a/hotel_channel_connector_wubook/models/hotel_reservation/common.py
+++ b/hotel_channel_connector_wubook/models/hotel_reservation/common.py
@@ -51,7 +51,7 @@ class ChannelHotelReservation(models.Model):
class HotelReservation(models.Model):
_inherit = 'hotel.reservation'
- @api.multi
+
def action_cancel(self):
for record in self:
# Can't cancel in Odoo
@@ -63,7 +63,7 @@ class HotelReservation(models.Model):
return super(HotelReservation, self).action_cancel()
- @api.multi
+
def confirm(self):
for record in self:
if record.is_from_ota:
diff --git a/hotel_channel_connector_wubook/models/inherited_hotel_room_type_class.py b/hotel_channel_connector_wubook/models/inherited_hotel_room_type_class.py
index ede1ffe97..2d5ce3755 100644
--- a/hotel_channel_connector_wubook/models/inherited_hotel_room_type_class.py
+++ b/hotel_channel_connector_wubook/models/inherited_hotel_room_type_class.py
@@ -10,14 +10,14 @@ class HotelRoomTypeClass(models.Model):
_locked_codes = ('1', '2', '3', '4', '5', '6', '7', '8')
- @api.multi
+
def write(self, vals):
for record in self:
if record.code_class in self._locked_codes:
raise ValidationError(_("Can't modify channel room type class"))
return super(HotelRoomTypeClass, self).write(vals)
- @api.multi
+
def unlink(self):
for record in self:
if record.code_class in self._locked_codes:
diff --git a/hotel_channel_connector_wubook/tests/common.py b/hotel_channel_connector_wubook/tests/common.py
index 22144473d..894a4f1fc 100644
--- a/hotel_channel_connector_wubook/tests/common.py
+++ b/hotel_channel_connector_wubook/tests/common.py
@@ -39,7 +39,7 @@ class TestHotelWubook(TestHotel):
def _init_mock_hotel(cls):
super()._init_mock_hotel()
- @api.multi
+
def wubook_ommit(self, *args, **kwargs):
return True
diff --git a/hotel_door_codes/models/inherit_hotel_reservation.py b/hotel_door_codes/models/inherit_hotel_reservation.py
index 7527030b8..1353a279c 100644
--- a/hotel_door_codes/models/inherit_hotel_reservation.py
+++ b/hotel_door_codes/models/inherit_hotel_reservation.py
@@ -28,7 +28,7 @@ class Inherit_hotel_reservation(models.Model):
_inherit = 'hotel.reservation'
# Default methods
- @api.multi
+
def _compute_door_codes(self):
for res in self:
entrada = datetime.strptime(
@@ -63,7 +63,7 @@ class Inherit_hotel_reservation(models.Model):
box_number = fields.Integer('Box Number')
box_code = fields.Char('Box code')
- @api.multi
+
def doorcode4(self, fecha):
# Calculate de Door Code... need a date in String format "%Y-%m-%d"
compan = self.env.user.hotel_id
diff --git a/hotel_door_codes/wizard/door_code.py b/hotel_door_codes/wizard/door_code.py
index c2f0c33e4..2a4a8416c 100644
--- a/hotel_door_codes/wizard/door_code.py
+++ b/hotel_door_codes/wizard/door_code.py
@@ -28,7 +28,7 @@ class DoorCodeWizard(models.TransientModel):
_description = 'Door Code Generator'
# Default methods
- @api.multi
+
def _get_default_date_start(self):
return datetime.now().strftime(DEFAULT_SERVER_DATE_FORMAT)
@@ -41,7 +41,7 @@ class DoorCodeWizard(models.TransientModel):
default=_get_default_date_start)
door_code = fields.Html("Door code")
- @api.multi
+
def check_code(self):
reservation = self.env['hotel.reservation']
diff --git a/hotel_ine/wizard/inewizard.py b/hotel_ine/wizard/inewizard.py
index 031381919..56bd0962b 100644
--- a/hotel_ine/wizard/inewizard.py
+++ b/hotel_ine/wizard/inewizard.py
@@ -68,7 +68,6 @@ class Wizard(models.TransientModel):
adr_screen = fields.Char()
rev_screen = fields.Char()
- @api.one
def generate_file(self):
_logger.warning("Start Export INE XML file")
last_day = calendar.monthrange(self.ine_year, self.ine_month)[1]
diff --git a/hotel_l10n_es/models/category_type.py b/hotel_l10n_es/models/category_type.py
index 4ae01b0e2..9f59cfbe3 100755
--- a/hotel_l10n_es/models/category_type.py
+++ b/hotel_l10n_es/models/category_type.py
@@ -28,7 +28,7 @@ class TourismCategory(models.Model):
name = fields.Char('Category', required=True)
category_type = fields.Char('Category type', required=True)
- @api.multi
+
def name_get(self):
data = []
for record in self:
diff --git a/hotel_l10n_es/models/code_ine.py b/hotel_l10n_es/models/code_ine.py
index 13ef99e80..7d00be2d4 100755
--- a/hotel_l10n_es/models/code_ine.py
+++ b/hotel_l10n_es/models/code_ine.py
@@ -29,7 +29,7 @@ class CodeIne(models.Model):
name = fields.Char('Place', required=True)
code = fields.Char('Code', required=True)
- @api.multi
+
def name_get(self):
data = []
for record in self:
diff --git a/hotel_l10n_es/models/inherit_hotel_checkin_partner.py b/hotel_l10n_es/models/inherit_hotel_checkin_partner.py
index 97f13c93c..f8cb4cfb5 100755
--- a/hotel_l10n_es/models/inherit_hotel_checkin_partner.py
+++ b/hotel_l10n_es/models/inherit_hotel_checkin_partner.py
@@ -55,7 +55,7 @@ class HotelCheckinPartner(models.Model):
vals.pop('lastname')
return super(HotelCheckinPartner, self).create(vals)
- @api.multi
+
def write(self, vals):
for record in self:
if not vals.get('partner_id') and not record.partner_id:
@@ -71,7 +71,7 @@ class HotelCheckinPartner(models.Model):
vals.pop('lastname')
return super(HotelCheckinPartner, self).write(vals)
- @api.multi
+
def action_on_board(self):
self.check_required_fields()
return super(HotelCheckinPartner, self).action_on_board()
@@ -107,7 +107,7 @@ class HotelCheckinPartner(models.Model):
if partner:
record.update({'partner_id': partner})
- @api.multi
+
def check_required_fields(self):
for record in self:
missing_fields = []
diff --git a/hotel_l10n_es/models/inherit_hotel_reservation.py b/hotel_l10n_es/models/inherit_hotel_reservation.py
index d50f48cbe..640e5f199 100644
--- a/hotel_l10n_es/models/inherit_hotel_reservation.py
+++ b/hotel_l10n_es/models/inherit_hotel_reservation.py
@@ -24,7 +24,7 @@ from openerp import models, api
class HotelReservation(models.Model):
_inherit = 'hotel.reservation'
- @api.multi
+
def print_all_checkins(self):
checkins = self.env['hotel.checkin.partner']
for record in self:
diff --git a/hotel_l10n_es/models/inherit_res_partner.py b/hotel_l10n_es/models/inherit_res_partner.py
index 172028ce7..d9102b6d9 100755
--- a/hotel_l10n_es/models/inherit_res_partner.py
+++ b/hotel_l10n_es/models/inherit_res_partner.py
@@ -91,7 +91,7 @@ class ResPartner(models.Model):
duplicated_fields = ['vat', 'document_number']
return duplicated_fields
- @api.multi
+
def write(self, vals):
if vals.get('vat') and not self._context.get(
"ignore_vat_update", False):
@@ -198,7 +198,7 @@ class ResPartner(models.Model):
"The Document Number %s already exists in another "
"partner.") % record.document_number)
- @api.multi
+
def open_main_partner(self):
self.ensure_one()
action = self.env.ref('base.action_partner_form').read()[0]
@@ -439,7 +439,7 @@ class ResPartner(models.Model):
reverse=True,
)
- @api.multi
+
def _compute_models(self):
""" Compute the different models needed by the system if you want to exclude some partners. """
model_mapping = {}
diff --git a/hotel_l10n_es/wizard/police_wizard.py b/hotel_l10n_es/wizard/police_wizard.py
index 3927215ab..141dcdb0c 100755
--- a/hotel_l10n_es/wizard/police_wizard.py
+++ b/hotel_l10n_es/wizard/police_wizard.py
@@ -39,7 +39,6 @@ class PoliceWizard(models.TransientModel):
log_police = fields.Char()
error_partner = fields.Many2one('res.partner')
- @api.one
def generate_file(self):
company = self.env.user.company_id
if company.police_number is not False and company.property_name is not False:
diff --git a/kellys_daily_report/wizard/kellys_daily_pdf.py b/kellys_daily_report/wizard/kellys_daily_pdf.py
index e6be2ef36..9a7eb33eb 100644
--- a/kellys_daily_report/wizard/kellys_daily_pdf.py
+++ b/kellys_daily_report/wizard/kellys_daily_pdf.py
@@ -45,13 +45,13 @@ class KellysWizard(models.TransientModel):
required=True,
help='Establece el orden en el que se imprimira el listado')
- @api.multi
+
def calculate_report(self):
self.habitaciones = self.calculalimpiar(
datetime.strptime(self.date_start, "%Y-%m-%d"))
return
- @api.multi
+
def calculalimpiar(self, fechalimpieza=datetime.now()):
dates = datetime.strftime(fechalimpieza, "%Y-%m-%d")
grids = self.env['hotel.room'].search([], order='sequence ASC')
@@ -113,7 +113,7 @@ class KellysWizard(models.TransientModel):
}).id)
return self.env['kellysrooms'].search([('id', 'in', listid)])
- @api.multi
+
def print_rooms_report(self):
rooms = self.env['kellysrooms'].search([('id', 'in',
self.habitaciones.ids)],
diff --git a/mail_reply_to_sender/models/ir_mail_server.py b/mail_reply_to_sender/models/ir_mail_server.py
index 2070d7c37..cb290fffe 100644
--- a/mail_reply_to_sender/models/ir_mail_server.py
+++ b/mail_reply_to_sender/models/ir_mail_server.py
@@ -5,7 +5,7 @@ from odoo import models,api
class MailComposer(models.TransientModel):
_inherit = 'mail.compose.message'
- @api.multi
+
def get_mail_values(self, res_ids):
res = super(MailComposer, self).get_mail_values(res_ids)
if self.composition_mode == 'comment':
diff --git a/pms/__manifest__.py b/pms/__manifest__.py
index a6bb73dd2..35c2ee80c 100644
--- a/pms/__manifest__.py
+++ b/pms/__manifest__.py
@@ -4,7 +4,7 @@
{
'name': 'pms',
'summary': "A property management system",
- 'version': '11.0.2.0.0',
+ 'version': '13.0.1.0.0',
'development_status': 'Beta',
'category': 'Generic Modules/Property Management System',
'website': 'https://github.com/hootel/hootel',
@@ -13,14 +13,13 @@
'Jose Luis Algara, '
'Pablo Quesada ',
'license': "AGPL-3",
- 'application': False,
+ 'application': True,
'installable': True,
'depends': [
'base',
'mail',
'account_payment_return',
'partner_firstname',
- 'account_cancel',
'email_template_qweb'
],
'data': [
diff --git a/pms/models/inherited_account_invoice.py b/pms/models/inherited_account_invoice.py
index af626ef9b..f6d06ec66 100644
--- a/pms/models/inherited_account_invoice.py
+++ b/pms/models/inherited_account_invoice.py
@@ -6,8 +6,8 @@ import json
from odoo.tools import float_is_zero
-class AccountInvoice(models.Model):
- _inherit = 'account.invoice'
+class AccountMove(models.Model):
+ _inherit = 'account.move'
# Field Declarations
folio_ids = fields.Many2many(
@@ -23,20 +23,20 @@ class AccountInvoice(models.Model):
compute='_get_outstanding_folios_JSON')
# Compute and Search methods
- @api.multi
+
def _computed_folio_origin(self):
for inv in self:
- folios = inv.mapped('invoice_line_ids.reservation_ids.folio_id')
- folios |= inv.mapped('invoice_line_ids.service_ids.folio_id')
+ folios = inv.mapped('move_line_ids.reservation_ids.folio_id')
+ folios |= inv.mapped('move_line_ids.service_ids.folio_id')
if folios:
inv.from_folio = True
inv.folio_ids = [(6, 0, folios.ids)]
# Action methods
- @api.multi
+
def action_folio_payments(self):
self.ensure_one()
- sales = self.mapped('invoice_line_ids.sale_line_ids.order_id')
+ sales = self.mapped('move_line_ids.sale_line_ids.order_id')
folios = self.env['pms.folio'].search([
('order_id.id', 'in', sales.ids)
])
@@ -54,8 +54,8 @@ class AccountInvoice(models.Model):
}
# Business methods
- @api.one
def _get_outstanding_folios_JSON(self):
+ self.ensure_one()
self.outstanding_folios_debits_widget = json.dumps(False)
if self.from_folio:
payment_ids = self.folio_ids.mapped('payment_ids.id')
@@ -82,7 +82,7 @@ class AccountInvoice(models.Model):
info = {'title': '',
'outstanding': True,
'content': [],
- 'invoice_id': self.id}
+ 'move_id': self.id}
lines = self.env['account.move.line'].search(domain)
currency_id = self.currency_id
if len(lines) != 0:
diff --git a/pms/models/inherited_account_invoice_line.py b/pms/models/inherited_account_invoice_line.py
index c1fa24499..1800b96ac 100644
--- a/pms/models/inherited_account_invoice_line.py
+++ b/pms/models/inherited_account_invoice_line.py
@@ -4,22 +4,22 @@
from odoo import fields, models
-class AccountInvoiceLine(models.Model):
- _inherit = 'account.invoice.line'
+class AccountMoveLine(models.Model):
+ _inherit = 'account.move.line'
# Fields declaration
reservation_ids = fields.Many2many(
'pms.reservation',
- 'reservation_invoice_rel',
- 'invoice_line_id', 'reservation_id',
+ 'reservation_move_rel',
+ 'move_line_id', 'reservation_id',
string='Reservations', readonly=True, copy=False)
service_ids = fields.Many2many(
'pms.service',
- 'service_line_invoice_rel',
- 'invoice_line_id', 'service_id',
+ 'service_line_move_rel',
+ 'move_line_id', 'service_id',
string='Services', readonly=True, copy=False)
reservation_line_ids = fields.Many2many(
'pms.reservation.line',
- 'reservation_line_invoice_rel',
- 'invoice_line_id', 'reservation_line_id',
+ 'reservation_line_move_rel',
+ 'move_line_id', 'reservation_line_id',
string='Reservation Lines', readonly=True, copy=False)
diff --git a/pms/models/inherited_account_payment.py b/pms/models/inherited_account_payment.py
index 0bd351b40..d21ad0555 100644
--- a/pms/models/inherited_account_payment.py
+++ b/pms/models/inherited_account_payment.py
@@ -20,7 +20,7 @@ class AccountPayment(models.Model):
save_journal_id = fields.Integer()
# Compute and Search methods
- @api.multi
+
@api.depends('state')
def _compute_folio_amount(self):
# FIXME: Finalize method
@@ -52,7 +52,7 @@ class AccountPayment(models.Model):
# Action methods
"""WIP"""
- @api.multi
+
def return_payment_folio(self):
journal = self.journal_id
partner = self.partner_id
@@ -81,7 +81,7 @@ class AccountPayment(models.Model):
return_pay.action_confirm()
# Business methods
- @api.multi
+
def modify(self):
self.cancel()
vals = {
@@ -109,7 +109,7 @@ class AccountPayment(models.Model):
self.save_journal_id).name, self.journal_id.name)
self.folio_id.message_post(subject=_('Payment'), body=msg)
- @api.multi
+
def delete(self):
msg = False
if self.folio_id:
@@ -121,7 +121,7 @@ class AccountPayment(models.Model):
if msg:
self.folio_id.message_post(subject=_('Payment Deleted'), body=msg)
- @api.multi
+
def post(self):
rec = super(AccountPayment, self).post()
if rec and not self._context.get("ignore_notification_post", False):
@@ -133,11 +133,11 @@ class AccountPayment(models.Model):
pay.communication, pay.journal_id.name)
pay.folio_id.message_post(subject=_('Payment'), body=msg)
- @api.multi
+
def modify_payment(self):
self.ensure_one()
view_form_id = self.env.ref('pms.account_payment_view_form_folio').id
- # invoices = self.mapped('invoice_ids.id')
+ # moves = self.mapped('move_ids.id')
return{
'name': _('Payment'),
'view_type': 'form',
diff --git a/pms/models/inherited_mail_compose_message.py b/pms/models/inherited_mail_compose_message.py
index 4cc4fda01..054019c63 100644
--- a/pms/models/inherited_mail_compose_message.py
+++ b/pms/models/inherited_mail_compose_message.py
@@ -7,7 +7,7 @@ from odoo import api, models
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
- @api.multi
+
def send_mail(self, auto_commit=False):
if self._context.get('default_model') == 'pms.folio' and \
self._context.get('default_res_id') and \
diff --git a/pms/models/inherited_payment_return.py b/pms/models/inherited_payment_return.py
index 458e72111..0c1210504 100644
--- a/pms/models/inherited_payment_return.py
+++ b/pms/models/inherited_payment_return.py
@@ -17,7 +17,7 @@ class PaymentReturn(models.Model):
related='folio_id.pms_property_id')
# Business methods
- @api.multi
+
def action_confirm(self):
pay = super(PaymentReturn, self).action_confirm()
if pay:
diff --git a/pms/models/inherited_res_users.py b/pms/models/inherited_res_users.py
index 16ab1b4a5..e2533ba5f 100644
--- a/pms/models/inherited_res_users.py
+++ b/pms/models/inherited_res_users.py
@@ -22,6 +22,6 @@ class ResUsers(models.Model):
'pms.property',
'pms_property_users_rel',
'user_id',
- 'property_id',
+ 'pms_property_id',
string='Properties',
default=_get_default_pms_property)
diff --git a/pms/models/pms_board_service_room_type.py b/pms/models/pms_board_service_room_type.py
index 6876fc19f..0b262c8b6 100644
--- a/pms/models/pms_board_service_room_type.py
+++ b/pms/models/pms_board_service_room_type.py
@@ -13,7 +13,7 @@ class PmsBoardServiceRoomType(models.Model):
_description = 'Board Service included in Room'
# Default Methods ang Gets
- @api.multi
+
def name_get(self):
result = []
for res in self:
@@ -100,7 +100,7 @@ class PmsBoardServiceRoomType(models.Model):
can't repeat without pricelist"))
# Action methods
- @api.multi
+
def open_board_lines_form(self):
action = self.env.ref(
'pms.action_pms_board_service_room_type_view').read()[0]
@@ -111,7 +111,6 @@ class PmsBoardServiceRoomType(models.Model):
return action
# ORM Overrides
- @api.model_cr
def init(self):
self._cr.execute(
'SELECT indexname FROM pg_indexes WHERE indexname = %s',
@@ -131,7 +130,7 @@ class PmsBoardServiceRoomType(models.Model):
)
return super(PmsBoardServiceRoomType, self).create(vals)
- @api.multi
+
def write(self, vals):
if 'pms_board_service_id' in vals:
vals.update(
diff --git a/pms/models/pms_checkin_partner.py b/pms/models/pms_checkin_partner.py
index 5c9045226..2863d0b26 100644
--- a/pms/models/pms_checkin_partner.py
+++ b/pms/models/pms_checkin_partner.py
@@ -111,7 +111,7 @@ class PmsCheckinPartner(models.Model):
track_visibility='onchange')
# Constraints and onchanges
- @api.multi
+
@api.constrains('exit_date', 'enter_date')
def _check_exit_date(self):
for record in self:
@@ -133,7 +133,7 @@ class PmsCheckinPartner(models.Model):
_('Departure date, is prior to arrival. Check it now. %s') %
date_out)
- @api.multi
+
@api.onchange('partner_id')
def _check_partner_id(self):
for record in self:
@@ -152,7 +152,7 @@ class PmsCheckinPartner(models.Model):
_('This guest is already registered in the room'))
# Action methods
- @api.multi
+
def action_on_board(self):
for record in self:
if record.reservation_id.checkin > fields.Date.today():
@@ -185,7 +185,7 @@ class PmsCheckinPartner(models.Model):
"type": "ir.actions.do_nothing",
}
- @api.multi
+
def action_done(self):
for record in self:
if record.state == 'booking':
diff --git a/pms/models/pms_folio.py b/pms/models/pms_folio.py
index de6767845..ca11acba5 100644
--- a/pms/models/pms_folio.py
+++ b/pms/models/pms_folio.py
@@ -113,8 +113,8 @@ class PmsFolio(models.Model):
checkin_partner_ids = fields.One2many(
'pms.checkin.partner',
'folio_id')
- invoice_ids = fields.Many2many(
- 'account.invoice',
+ move_ids = fields.Many2many(
+ 'account.move',
string='Invoices',
compute='_get_invoiced',
readonly=True,
@@ -279,14 +279,14 @@ class PmsFolio(models.Model):
refund is not directly linked to the Folio.
"""
for folio in self:
- invoice_ids = folio.reservation_ids.mapped('invoice_line_ids').\
- mapped('invoice_id').filtered(lambda r: r.type in [
+ move_ids = folio.reservation_ids.mapped('move_line_ids').\
+ mapped('move_id').filtered(lambda r: r.type in [
'out_invoice', 'out_refund'])
- invoice_ids |= folio.service_ids.mapped('invoice_line_ids').mapped(
- 'invoice_id').filtered(lambda r: r.type in [
+ invoice_ids |= folio.service_ids.mapped('move_line_ids').mapped(
+ 'move_id').filtered(lambda r: r.type in [
'out_invoice', 'out_refund'])
# TODO: Search for invoices which have been 'cancelled'
- # (filter_refund = 'modify' in 'account.invoice.refund')
+ # (filter_refund = 'modify' in 'account.move.refund')
# use like as origin may contains multiple references
# (e.g. 'SO01, SO02')
refunds = invoice_ids.search([
@@ -296,7 +296,7 @@ class PmsFolio(models.Model):
invoice_ids |= refunds.filtered(
lambda r: folio.id in r.folio_ids.ids)
# Search for refunds as well
- refund_ids = self.env['account.invoice'].browse()
+ refund_ids = self.env['account.move'].browse()
if invoice_ids:
for inv in invoice_ids:
refund_ids += refund_ids.search([
@@ -330,8 +330,8 @@ class PmsFolio(models.Model):
invoice_status = 'no'
folio.update({
- 'invoice_count': len(set(invoice_ids.ids + refund_ids.ids)),
- 'invoice_ids': invoice_ids.ids + refund_ids.ids,
+ 'invoice_count': len(set(move_ids.ids + refund_ids.ids)),
+ 'invoice_ids': move_ids.ids + refund_ids.ids,
'invoice_status': invoice_status
})
@@ -357,7 +357,7 @@ class PmsFolio(models.Model):
@api.depends('amount_total', 'payment_ids', 'return_ids',
'reservation_type', 'state')
- @api.multi
+
def compute_amount(self):
acc_pay_obj = self.env['account.payment']
for record in self:
@@ -466,7 +466,7 @@ class PmsFolio(models.Model):
self.has_checkout_to_send = False
# Constraints and onchanges
- @api.multi
+
@api.onchange('partner_id')
def onchange_partner_id(self):
"""
@@ -478,13 +478,13 @@ class PmsFolio(models.Model):
"""
if not self.partner_id:
self.update({
- 'partner_invoice_id': False,
+ 'partner_move_id': False,
'payment_term_id': False,
'fiscal_position_id': False,
})
return
- addr = self.partner_id.address_get(['invoice'])
+ addr = self.partner_id.address_get(['move'])
pricelist = self.partner_id.property_product_pricelist and \
self.partner_id.property_product_pricelist.id or \
self.env.user.pms_property_id.default_pricelist_id.id
@@ -506,7 +506,7 @@ class PmsFolio(models.Model):
values['team_id'] = self.partner_id.team_id.id
self.update(values)
- @api.multi
+
@api.onchange('pricelist_id')
def onchange_pricelist_id(self):
values = {'reservation_type': self.env['pms.folio'].
@@ -517,7 +517,7 @@ class PmsFolio(models.Model):
self.update(values)
# Action methods
- @api.multi
+
def action_pay(self):
self.ensure_one()
partner = self.partner_id.id
@@ -541,31 +541,31 @@ class PmsFolio(models.Model):
'target': 'new',
}
- @api.multi
- def open_invoices_folio(self):
- invoices = self.mapped('invoice_ids')
- action = self.env.ref('account.action_invoice_tree1').read()[0]
+
+ def open_moves_folio(self):
+ invoices = self.mapped('move_ids')
+ action = self.env.ref('account.action_move_out_invoice_type').read()[0]
if len(invoices) > 1:
action['domain'] = [('id', 'in', invoices.ids)]
elif len(invoices) == 1:
action['views'] = [
- (self.env.ref('account.invoice_form').id, 'form')]
+ (self.env.ref('account.view_move_form').id, 'form')]
action['res_id'] = invoices.ids[0]
else:
action = {'type': 'ir.actions.act_window_close'}
return action
- @api.multi
+
def action_return_payments(self):
self.ensure_one()
return_move_ids = []
acc_pay_obj = self.env['account.payment']
payments = acc_pay_obj.search([
'|',
- ('invoice_ids', 'in', self.invoice_ids.ids),
+ ('move_ids', 'in', self.move_ids.ids),
('folio_id', '=', self.id)
])
- return_move_ids += self.invoice_ids.filtered(
+ return_move_ids += self.move_ids.filtered(
lambda invoice: invoice.type == 'out_refund').mapped(
'payment_move_line_ids.move_id.id')
return_lines = self.env['payment.return.line'].search([
@@ -582,7 +582,7 @@ class PmsFolio(models.Model):
'domain': [('id', 'in', return_move_ids)],
}
- @api.multi
+
def action_checks(self):
self.ensure_one()
rooms = self.mapped('reservation_ids.id')
@@ -596,7 +596,7 @@ class PmsFolio(models.Model):
'target': 'new',
}
- @api.multi
+
def send_reservation_mail(self):
'''
This function opens a window to compose an email,
@@ -642,7 +642,7 @@ class PmsFolio(models.Model):
'force_send': True
}
- @api.multi
+
def send_exit_mail(self):
'''
This function opens a window to compose an email,
@@ -688,7 +688,7 @@ class PmsFolio(models.Model):
'force_send': True
}
- @api.multi
+
def send_cancel_mail(self):
'''
This function opens a window to compose an email,
@@ -773,14 +773,14 @@ class PmsFolio(models.Model):
else:
return 'normal'
- @api.multi
+
def action_done(self):
reservation_ids = self.mapped('reservation_ids')
for line in reservation_ids:
if line.state == "booking":
line.action_reservation_checkout()
- @api.multi
+
def action_cancel(self):
for folio in self:
for reservation in folio.reservation_ids.filtered(
@@ -791,7 +791,7 @@ class PmsFolio(models.Model):
})
return True
- @api.multi
+
def action_confirm(self):
for folio in self.filtered(lambda folio: folio.partner_id not in
folio.message_partner_ids):
@@ -814,7 +814,7 @@ class PmsFolio(models.Model):
CHECKIN/OUT PROCESS
"""
- @api.multi
+
def _compute_checkin_partner_count(self):
for record in self:
if record.reservation_type == 'normal' and record.reservation_ids:
@@ -830,7 +830,7 @@ class PmsFolio(models.Model):
record.checkin_partner_pending_count = sum(
mapped_checkin_partner_count)
- @api.multi
+
def get_grouped_reservations_json(self, state, import_all=False):
self.ensure_one()
info_grouped = []
@@ -873,7 +873,7 @@ class PmsFolio(models.Model):
reverse=True),
key=lambda k: k['room_type']['id'])
- @api.multi
+
def _get_tax_amount_by_group(self):
self.ensure_one()
res = {}
diff --git a/pms/models/pms_reservation.py b/pms/models/pms_reservation.py
index e63be304b..b27bc2b24 100644
--- a/pms/models/pms_reservation.py
+++ b/pms/models/pms_reservation.py
@@ -163,11 +163,11 @@ class PmsReservation(models.Model):
string='Taxes',
ondelete='restrict',
domain=['|', ('active', '=', False), ('active', '=', True)])
- invoice_line_ids = fields.Many2many(
- 'account.invoice.line',
- 'reservation_invoice_rel',
+ move_line_ids = fields.Many2many(
+ 'account.move.line',
+ 'reservation_move_rel',
'reservation_id',
- 'invoice_line_id',
+ 'move_line_id',
string='Invoice Lines',
copy=False)
analytic_tag_ids = fields.Many2many(
@@ -386,8 +386,8 @@ class PmsReservation(models.Model):
else:
line.qty_to_invoice = 0
- @api.depends('invoice_line_ids.invoice_id.state',
- 'invoice_line_ids.quantity')
+ @api.depends('move_line_ids.move_id.state',
+ 'move_line_ids.quantity')
def _get_invoice_qty(self):
"""
Compute the quantity invoiced. If case of a refund, the quantity
@@ -397,12 +397,12 @@ class PmsReservation(models.Model):
for line in self:
qty_invoiced = 0.0
for day in line.reservation_line_ids:
- invoice_lines = day.invoice_line_ids.filtered(
- lambda r: r.invoice_id.state != 'cancel')
+ invoice_lines = day.move_line_ids.filtered(
+ lambda r: r.move_id.state != 'cancel')
qty_invoiced += len(invoice_lines.filtered(
- lambda r: r.invoice_id.type == 'out_invoice')
+ lambda r: r.move_id.type == 'out_invoice')
) - len(invoice_lines.filtered(
- lambda r: r.invoice_id.type ==
+ lambda r: r.move_id.type ==
'out_refund'))
line.qty_invoiced = qty_invoiced
@@ -512,7 +512,7 @@ class PmsReservation(models.Model):
reservation period: %s ') % occupied_name
raise ValidationError(warning_msg)
- @api.multi
+
@api.constrains('checkin_partner_ids')
def _max_checkin_partner_ids(self):
for record in self:
@@ -554,7 +554,7 @@ class PmsReservation(models.Model):
}
self.update(values)
- @api.multi
+
@api.onchange('pricelist_id')
def onchange_pricelist_id(self):
values = {'reservation_type': self.env['pms.folio'].
@@ -569,7 +569,7 @@ class PmsReservation(models.Model):
self.update({'partner_id':
self.env.user.company_id.partner_id.id})
- @api.multi
+
@api.onchange('checkin_partner_ids')
def onchange_checkin_partner_ids(self):
for record in self:
@@ -640,7 +640,7 @@ class PmsReservation(models.Model):
for service in services:
service.onchange_product_id()
- @api.multi
+
@api.onchange('checkin', 'checkout', 'room_id')
def onchange_room_availabiltiy_domain(self):
self.ensure_one()
@@ -704,15 +704,15 @@ class PmsReservation(models.Model):
service.price_unit = service._compute_price_unit()
# Action methods
- @api.multi
+
def open_invoices_reservation(self):
- invoices = self.folio_id.mapped('invoice_ids')
- action = self.env.ref('account.action_invoice_tree1').read()[0]
+ invoices = self.folio_id.mapped('move_ids')
+ action = self.env.ref('account.action_move_out_invoice_type').read()[0]
if len(invoices) > 1:
action['domain'] = [('id', 'in', invoices.ids)]
elif len(invoices) == 1:
action['views'] = [
- (self.env.ref('account.invoice_form').id, 'form')]
+ (self.env.ref('account.view_move_form').id, 'form')]
action['res_id'] = invoices.ids[0]
else:
action = self.env.ref(
@@ -721,7 +721,7 @@ class PmsReservation(models.Model):
'default_folio_id': self.folio_id.id}
return action
- @api.multi
+
def create_invoice(self):
action = self.env.ref(
'pms.action_view_folio_advance_payment_inv').read()[0]
@@ -729,7 +729,7 @@ class PmsReservation(models.Model):
'default_folio_id': self.folio_id.id}
return action
- @api.multi
+
def open_folio(self):
action = self.env.ref(
'pms.open_pms_folio1_form_tree_all').read()[0]
@@ -741,7 +741,7 @@ class PmsReservation(models.Model):
action = {'type': 'ir.actions.act_window_close'}
return action
- @api.multi
+
def open_reservation_form(self):
action = self.env.ref(
'pms.open_pms_reservation_form_tree_all').read()[0]
@@ -750,12 +750,12 @@ class PmsReservation(models.Model):
action['res_id'] = self.id
return action
- @api.multi
+
def action_pay_folio(self):
self.ensure_one()
return self.folio_id.action_pay()
- @api.multi
+
def action_pay_reservation(self):
self.ensure_one()
partner = self.partner_id.id
@@ -795,7 +795,7 @@ class PmsReservation(models.Model):
return super(PmsReservation, self).name_search(
name='', args=args, operator='ilike', limit=limit)
- @api.multi
+
def name_get(self):
result = []
for res in self:
@@ -853,7 +853,7 @@ class PmsReservation(models.Model):
record.confirm()
return record
- @api.multi
+
def write(self, vals):
if self.notify_update(vals):
vals.update({
@@ -937,7 +937,7 @@ class PmsReservation(models.Model):
return record
# Business methods
- @api.multi
+
def _computed_shared(self):
# Has this reservation more charges associates in folio?,
# Yes?, then, this is share folio ;)
@@ -948,7 +948,7 @@ class PmsReservation(models.Model):
or any(record.folio_id.service_ids.filtered(
lambda x: x.reservation_id.id != record.id))
- @api.multi
+
def compute_board_services(self, vals):
"""
We must compute service_ids when we have a board_service_id without
@@ -963,7 +963,7 @@ class PmsReservation(models.Model):
return True
return False
- @api.multi
+
def compute_qty_service_day(self, vals):
"""
Compute if it is necesary calc price in write/create
@@ -1047,7 +1047,7 @@ class PmsReservation(models.Model):
subtype='mt_comment', body=msg)
return True
- @api.multi
+
def notify_update(self, vals):
if 'checkin' in vals or \
'checkout' in vals or \
@@ -1058,12 +1058,12 @@ class PmsReservation(models.Model):
return True
return False
- @api.multi
+
def overbooking_button(self):
self.ensure_one()
self.overbooking = not self.overbooking
- @api.multi
+
def generate_copy_values(self, checkin=False, checkout=False):
self.ensure_one()
return {
@@ -1091,7 +1091,7 @@ class PmsReservation(models.Model):
STATE WORKFLOW -----------------------------------------------------
"""
- @api.multi
+
def confirm(self):
'''
@param self: object pointer
@@ -1130,7 +1130,7 @@ class PmsReservation(models.Model):
splitted_reservs.confirm()
return True
- @api.multi
+
def button_done(self):
'''
@param self: object pointer
@@ -1139,7 +1139,7 @@ class PmsReservation(models.Model):
record.action_reservation_checkout()
return True
- @api.multi
+
def action_cancel(self):
for record in self:
cancel_reason = 'intime' if self._context.get(
@@ -1166,7 +1166,7 @@ class PmsReservation(models.Model):
splitted_reservs.action_cancel()
record.folio_id.compute_amount()
- @api.multi
+
def compute_cancelation_reason(self):
self.ensure_one()
pricelist = self.pricelist_id
@@ -1184,7 +1184,7 @@ class PmsReservation(models.Model):
return 'intime'
return False
- @api.multi
+
def draft(self):
for record in self:
record.state = 'draft'
@@ -1207,7 +1207,7 @@ class PmsReservation(models.Model):
"""
PRICE PROCESS ------------------------------------------------------
"""
- @api.multi
+
def compute_price_out_vals(self, vals):
"""
Compute if It is necesary calc price in write/create
@@ -1220,7 +1220,7 @@ class PmsReservation(models.Model):
return True
return False
- @api.multi
+
def _compute_cancelled_discount(self):
self.ensure_one()
pricelist = self.pricelist_id
@@ -1378,7 +1378,7 @@ class PmsReservation(models.Model):
CHECKIN/OUT PROCESS ------------------------------------------------
"""
- @api.multi
+
def _compute_checkin_partner_count(self):
_logger.info('_compute_checkin_partner_count')
for record in self:
@@ -1392,14 +1392,14 @@ class PmsReservation(models.Model):
record.checkin_partner_pending_count = 0
# https://www.odoo.com/es_ES/forum/ayuda-1/question/calculated-fields-in-search-filter-possible-118501
- @api.multi
+
def _search_checkin_partner_pending(self, operator, value):
self.ensure_one()
recs = self.search([]).filtered(
lambda x: x.checkin_partner_pending_count > 0)
return [('id', 'in', [x.id for x in recs])] if recs else []
- @api.multi
+
def action_reservation_checkout(self):
for record in self:
record.state = 'done'
@@ -1421,7 +1421,7 @@ class PmsReservation(models.Model):
splitted_reservs.update({'state': 'done'})
return True
- @api.multi
+
def action_checks(self):
self.ensure_one()
action = self.env.ref(
@@ -1437,7 +1437,7 @@ class PmsReservation(models.Model):
RESERVATION SPLITTED -----------------------------------------------
"""
- @api.multi
+
def split(self, nights):
for record in self:
date_start_dt = fields.Date.from_string(record.checkin)
@@ -1463,7 +1463,7 @@ class PmsReservation(models.Model):
'price': rline.price,
'cancel_discount': rline.cancel_discount,
'discount': rline.discount,
- 'invoice_line_ids': rline.invoice_line_ids,
+ 'move_line_ids': rline.move_line_ids,
'state': rline.state,
}))
reservation_lines[0].append((2, rline.id, False))
@@ -1490,7 +1490,7 @@ class PmsReservation(models.Model):
})
return True
- @api.multi
+
def unify(self):
self.ensure_one()
if not self.splitted:
@@ -1548,7 +1548,7 @@ class PmsReservation(models.Model):
'price': rline.price,
'cancel_discount': rline.cancel_discount,
'discount': rline.discount,
- 'invoice_line_ids': rline.invoice_line_ids,
+ 'move_line_ids': rline.move_line_ids,
'state': rline.state,
}))
@@ -1570,7 +1570,7 @@ class PmsReservation(models.Model):
})
return True
- @api.multi
+
def open_master(self):
self.ensure_one()
if not self.parent_reservation:
@@ -1586,15 +1586,15 @@ class PmsReservation(models.Model):
MAILING PROCESS
"""
- @api.multi
+
def send_reservation_mail(self):
return self.folio_id.send_reservation_mail()
- @api.multi
+
def send_exit_mail(self):
return self.folio_id.send_exit_mail()
- @api.multi
+
def send_cancel_mail(self):
return self.folio_id.send_cancel_mail()
@@ -1602,7 +1602,7 @@ class PmsReservation(models.Model):
INVOICING PROCESS
"""
- @api.multi
+
def _compute_tax_ids(self):
for record in self:
# If company_id is set, always filter taxes by the company
@@ -1613,7 +1613,7 @@ class PmsReservation(models.Model):
lambda r: not record.company_id or
r.company_id == folio.company_id)
- @api.multi
+
def set_call_center_user(self):
user = self.env['res.users'].browse(self.env.uid)
return user.has_group('pms.group_pms_call')
diff --git a/pms/models/pms_reservation_line.py b/pms/models/pms_reservation_line.py
index d2300a29a..6cb69f7c3 100644
--- a/pms/models/pms_reservation_line.py
+++ b/pms/models/pms_reservation_line.py
@@ -11,7 +11,7 @@ class PmsReservationLine(models.Model):
_order = "date"
# Default Methods ang Gets
- @api.multi
+
def name_get(self):
result = []
for res in self:
@@ -27,11 +27,11 @@ class PmsReservationLine(models.Model):
ondelete='cascade',
required=True,
copy=False)
- invoice_line_ids = fields.Many2many(
- 'account.invoice.line',
- 'reservation_line_invoice_rel',
+ move_line_ids = fields.Many2many(
+ 'account.move.line',
+ 'reservation_line_move_rel',
'reservation_line_id',
- 'invoice_line_id',
+ 'move_line_id',
string='Invoice Lines',
readonly=True,
copy=False)
diff --git a/pms/models/pms_room.py b/pms/models/pms_room.py
index c6204fce6..603274a31 100644
--- a/pms/models/pms_room.py
+++ b/pms/models/pms_room.py
@@ -67,7 +67,7 @@ class PmsRoom(models.Model):
of another property."))
return super().create(vals)
- @api.multi
+
def write(self, vals):
for record in self:
if vals.get('pms_property_id', record.pms_property_id.id) != record.pms_property_id.id:
@@ -86,7 +86,7 @@ class PmsRoom(models.Model):
return super().write(vals)
# Business methods
- @api.multi
+
def get_capacity(self, extra_bed=0):
if not self.shared_room_id:
return self.capacity + extra_bed
diff --git a/pms/models/pms_room_type.py b/pms/models/pms_room_type.py
index bb5752b55..4ca354ab7 100644
--- a/pms/models/pms_room_type.py
+++ b/pms/models/pms_room_type.py
@@ -80,14 +80,14 @@ class PmsRoomType(models.Model):
})
return super().create(vals)
- @api.multi
+
def unlink(self):
for record in self:
record.product_id.unlink()
return super().unlink()
# Business methods
- @api.multi
+
def get_capacity(self):
self.ensure_one()
capacities = self.room_ids.mapped('capacity')
diff --git a/pms/models/pms_room_type_restriction_item.py b/pms/models/pms_room_type_restriction_item.py
index 546840545..3a74bcd76 100644
--- a/pms/models/pms_room_type_restriction_item.py
+++ b/pms/models/pms_room_type_restriction_item.py
@@ -29,7 +29,7 @@ class PmsRoomTypeRestrictionItem(models.Model):
day for the same room type!')]
# Constraints and onchanges
- @api.multi
+
@api.constrains('min_stay', 'min_stay_arrival', 'max_stay',
'max_stay_arrival')
def _check_min_stay(self):
diff --git a/pms/models/pms_service.py b/pms/models/pms_service.py
index e5d470691..be5021433 100644
--- a/pms/models/pms_service.py
+++ b/pms/models/pms_service.py
@@ -17,7 +17,7 @@ class PmsService(models.Model):
_description = 'Services and its charges'
# Default methods
- @api.multi
+
def name_get(self):
result = []
for rec in self:
@@ -77,12 +77,12 @@ class PmsService(models.Model):
'account.tax',
string='Taxes',
domain=['|', ('active', '=', False), ('active', '=', True)])
- invoice_line_ids = fields.Many2many(
- 'account.invoice.line',
- 'service_line_invoice_rel',
+ move_line_ids = fields.Many2many(
+ 'account.move.line',
+ 'service_line_move_rel',
'service_id',
- 'invoice_line_id',
- string='Invoice Lines',
+ 'move_line_id',
+ string='move Lines',
copy=False)
analytic_tag_ids = fields.Many2many(
'account.analytic.tag',
@@ -102,7 +102,7 @@ class PmsService(models.Model):
# Non-stored related field to allow portal user to
# see the image of the product he has ordered
product_image = fields.Binary(
- 'Product Image', related="product_id.image",
+ 'Product Image', related="product_id.image_1024",
store=False, related_sudo=True)
invoice_status = fields.Selection([
('invoiced', 'Fully Invoiced'),
@@ -169,8 +169,8 @@ class PmsService(models.Model):
else:
line.qty_to_invoice = 0
- @api.depends('invoice_line_ids.invoice_id.state',
- 'invoice_line_ids.quantity')
+ @api.depends('move_line_ids.move_id.state',
+ 'move_line_ids.quantity')
def _get_invoice_qty(self):
"""
Compute the quantity invoiced. If case of a refund,
@@ -183,13 +183,13 @@ class PmsService(models.Model):
"""
for line in self:
qty_invoiced = 0.0
- for invoice_line in line.invoice_line_ids:
- if invoice_line.invoice_id.state != 'cancel':
- if invoice_line.invoice_id.type == 'out_invoice':
+ for invoice_line in line.move_line_ids:
+ if invoice_line.move_id.state != 'cancel':
+ if invoice_line.move_id.type == 'out_invoice':
qty_invoiced += invoice_line.uom_id._compute_quantity(
invoice_line.quantity, line.product_id.uom_id)
- elif invoice_line.invoice_id.type == 'out_refund':
- qty_invoiced -= invoice_line.uom_id._compute_quantity(
+ elif invoice_line.move_id.type == 'out_refund':
+ qty_invoiced -= move_line.uom_id._compute_quantity(
invoice_line.quantity, line.product_id.uom_id)
line.qty_invoiced = qty_invoiced
@@ -337,7 +337,7 @@ class PmsService(models.Model):
record.update(vals)
# Action methods
- @api.multi
+
def open_service_ids(self):
action = self.env.ref('pms.action_pms_services_form').read()[0]
action['views'] = [
@@ -387,7 +387,7 @@ class PmsService(models.Model):
record = super(PmsService, self).create(vals)
return record
- @api.multi
+
def write(self, vals):
# If you write product, We must check if its necesary create or delete
# service lines
@@ -439,7 +439,7 @@ class PmsService(models.Model):
line[field], line)
return res
- @api.multi
+
def compute_lines_out_vals(self, vals):
"""
Compute if It is necesary service days in write/create
@@ -453,7 +453,7 @@ class PmsService(models.Model):
return True
return False
- @api.multi
+
def _compute_tax_ids(self):
for record in self:
# If company_id is set, always filter taxes by the company
@@ -466,7 +466,7 @@ class PmsService(models.Model):
lambda r: not record.company_id or
r.company_id == origin.company_id)
- @api.multi
+
def _get_display_price(self, product):
folio = self.folio_id or self.env.context.get('default_folio_id')
reservation = self.reservation_id or self.env.context.get(
@@ -499,7 +499,7 @@ class PmsService(models.Model):
# negative discounts (= surcharge) are included in the display price
return max(base_price, final_price)
- @api.multi
+
def _compute_price_unit(self):
self.ensure_one()
folio = self.folio_id or self.env.context.get('default_folio_id')
diff --git a/pms/views/inherited_account_invoice_views.xml b/pms/views/inherited_account_invoice_views.xml
index 0cab6b53a..5a24507a3 100644
--- a/pms/views/inherited_account_invoice_views.xml
+++ b/pms/views/inherited_account_invoice_views.xml
@@ -1,19 +1,19 @@
-
- account.invoice
-
+
+ account.move
+
-
+
-
+
{'invisible': ['|',('from_folio','=',True)]}
-
+
diff --git a/pms/views/pms_amenity_type_views.xml b/pms/views/pms_amenity_type_views.xml
index a46f4544f..b4a2a3d7d 100644
--- a/pms/views/pms_amenity_type_views.xml
+++ b/pms/views/pms_amenity_type_views.xml
@@ -36,7 +36,6 @@
Room amenity Type
pms.amenity.type
- form
tree,form
diff --git a/pms/views/pms_amenity_views.xml b/pms/views/pms_amenity_views.xml
index 41600506d..1f7a83eb6 100644
--- a/pms/views/pms_amenity_views.xml
+++ b/pms/views/pms_amenity_views.xml
@@ -1,8 +1,6 @@
-
-
pms.amenity.form
pms.amenity
@@ -64,7 +62,6 @@
-
pms.room_amenity_search
pms.amenity
@@ -83,7 +80,6 @@
-
pms.room_amenity_list
pms.amenity
@@ -96,11 +92,9 @@
-
Room Amenities
pms.amenity
- form
tree,form
diff --git a/pms/views/pms_board_service_room_type_views.xml b/pms/views/pms_board_service_room_type_views.xml
index 3165158a6..0cc582266 100644
--- a/pms/views/pms_board_service_room_type_views.xml
+++ b/pms/views/pms_board_service_room_type_views.xml
@@ -22,8 +22,7 @@
Board Service
- board.service.room.type
- form
+ pms.board.service.room.type
form
diff --git a/pms/views/pms_board_service_views.xml b/pms/views/pms_board_service_views.xml
index 4c244deb8..9e064516f 100644
--- a/pms/views/pms_board_service_views.xml
+++ b/pms/views/pms_board_service_views.xml
@@ -36,7 +36,6 @@
Board Services
pms.board.service
- form
tree,form
diff --git a/pms/views/pms_cancelation_rule_views.xml b/pms/views/pms_cancelation_rule_views.xml
index 7bc4f441a..6eddb0ed7 100644
--- a/pms/views/pms_cancelation_rule_views.xml
+++ b/pms/views/pms_cancelation_rule_views.xml
@@ -54,7 +54,6 @@
Cancelation Rules
pms.cancelation.rule
- form
tree,form
diff --git a/pms/views/pms_checkin_partner_views.xml b/pms/views/pms_checkin_partner_views.xml
index f316c9c78..5293b6530 100644
--- a/pms/views/pms_checkin_partner_views.xml
+++ b/pms/views/pms_checkin_partner_views.xml
@@ -103,13 +103,13 @@
-
-
-
Floor Structure
pms.floor
- form
tree,form
diff --git a/pms/views/pms_folio_views.xml b/pms/views/pms_folio_views.xml
index 10bc11c25..43c9380b9 100644
--- a/pms/views/pms_folio_views.xml
+++ b/pms/views/pms_folio_views.xml
@@ -3,10 +3,10 @@
+ target="new"
+ view_mode="form" />
pms.folio.form
@@ -114,7 +114,7 @@
-
+
@@ -300,11 +300,11 @@
domain="[('pending_amount', '>', 0)]" />
+ name="group_customer" context="{'group_by':'partner_id'}" />
+ name="group_invoice_contact" context="{'group_by':'partner_invoice_id'}" />
+ name="group_tour_operator" context="{'group_by':'tour_operator_id'}"/>
@@ -323,12 +323,9 @@
Folio
pms.folio
- form
tree,form,graph
diff --git a/pms/views/pms_property_views.xml b/pms/views/pms_property_views.xml
index fad05fef2..c4c83e412 100644
--- a/pms/views/pms_property_views.xml
+++ b/pms/views/pms_property_views.xml
@@ -62,7 +62,6 @@
pmss
pms.property
- form
tree,form
diff --git a/pms/views/pms_reservation_views.xml b/pms/views/pms_reservation_views.xml
index 6da855940..086bb6a03 100644
--- a/pms/views/pms_reservation_views.xml
+++ b/pms/views/pms_reservation_views.xml
@@ -3,7 +3,6 @@
Reservation
pms.reservation
- form
tree,form,graph,pivot
{'from_room': True}
@@ -557,18 +556,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pms/views/pms_room_closure_reason_views.xml b/pms/views/pms_room_closure_reason_views.xml
index 3e2da40a5..4add29fb8 100644
--- a/pms/views/pms_room_closure_reason_views.xml
+++ b/pms/views/pms_room_closure_reason_views.xml
@@ -30,7 +30,6 @@
Room Closure Reason
room.closure.reason
- form
tree,form