[IMP] Models py guide lines

This commit is contained in:
Dario Lodeiros
2019-09-24 20:11:40 +02:00
parent 857a8a6486
commit 54857a52d4
4 changed files with 14 additions and 14 deletions

View File

@@ -512,10 +512,11 @@ class HotelService(models.Model):
if reservation and self.is_board_service:
board_room_type = reservation.board_service_room_id
if board_room_type.price_type == 'fixed':
return self.env['hotel.board.service.room.type.line'].search([
('hotel_board_service_room_type_id',
'=', board_room_type.id),
('product_id', '=', self.product_id.id)]).amount
return self.env['hotel.board.service.room.type.line'].\
search([
('hotel_board_service_room_type_id',
'=', board_room_type.id),
('product_id', '=', self.product_id.id)]).amount
else:
return (reservation.price_total *
self.env['hotel.board.service.room.type.line'].

View File

@@ -27,7 +27,8 @@ class PaymentReturn(models.Model):
payments = self.env['account.payment'].search([
('move_line_ids', 'in', line.move_line_ids.ids)
])
folios_line = self.env['hotel.folio'].browse(payments.mapped('folio_id.id'))
folios_line = self.env['hotel.folio'].browse(
payments.mapped('folio_id.id'))
for folio in folios_line:
if self.id not in folio.return_ids.ids:
folio.update({'return_ids': [(4, self.id)]})

View File

@@ -12,15 +12,15 @@ class ResCompany(models.Model):
# TODO: need extra explanation or remove otherwise
# additional_hours = fields.Integer('Additional Hours',
# help="Provide the min hours value for \
# check in, checkout days, whatever \
# the hours will be provided here based \
# on that extra days will be \
# calculated.")
# check in, checkout days, whatever \
# the hours will be provided here based \
# on that extra days will be \
# calculated.")
# TODO: move the text to the default template for confirmed reservations
# cardex_warning = fields.Text(
# 'Warning in Cardex',
# default="Time to access rooms: 14: 00h. Departure time: \
# 12: 00h. If the accommodation is not left at that time, \
# the establishment will charge a day's stay according to \
# current rate that day",
# 12: 00h. If the accommodation is not left at that time, \
# the establishment will charge a day's stay according to \
# current rate that day",
# help="Notice under the signature on the traveler's ticket.")

View File

@@ -2,8 +2,6 @@
# Copyright 2017 Dario Lodeiros
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
from odoo.osv.expression import get_unaccent_wrapper
from odoo.exceptions import ValidationError
import logging
_logger = logging.getLogger(__name__)