mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[MIG] V13 conventions
This commit is contained in:
@@ -174,7 +174,7 @@ class GlassofExporterWizard(models.TransientModel):
|
|||||||
else:
|
else:
|
||||||
firstname = inv.partner_id.firstname or ''
|
firstname = inv.partner_id.firstname or ''
|
||||||
lastname = inv.partner_id.lastname or ''
|
lastname = inv.partner_id.lastname or ''
|
||||||
|
|
||||||
worksheet.write(nrow, 0, inv.number)
|
worksheet.write(nrow, 0, inv.number)
|
||||||
worksheet.write(nrow, 1, inv.date_invoice, xls_cell_format_date)
|
worksheet.write(nrow, 1, inv.date_invoice, xls_cell_format_date)
|
||||||
worksheet.write(nrow, 2, '')
|
worksheet.write(nrow, 2, '')
|
||||||
@@ -209,7 +209,7 @@ class GlassofExporterWizard(models.TransientModel):
|
|||||||
worksheet.write(nrow, 21, 'S')
|
worksheet.write(nrow, 21, 'S')
|
||||||
worksheet.write(nrow, 22, '')
|
worksheet.write(nrow, 22, '')
|
||||||
if inv.type == 'out_refund':
|
if inv.type == 'out_refund':
|
||||||
worksheet.write(nrow, 23, inv.origin)
|
worksheet.write(nrow, 23, inv.invoice_origin)
|
||||||
else:
|
else:
|
||||||
worksheet.write(nrow, 23, '')
|
worksheet.write(nrow, 23, '')
|
||||||
worksheet.write(nrow, 24, '')
|
worksheet.write(nrow, 24, '')
|
||||||
@@ -242,7 +242,7 @@ class GlassofExporterWizard(models.TransientModel):
|
|||||||
'xls_invoices_binary': base64.encodestring(file_data.read()),
|
'xls_invoices_binary': base64.encodestring(file_data.read()),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def export(self):
|
def export(self):
|
||||||
towrite = {}
|
towrite = {}
|
||||||
if self.export_journals:
|
if self.export_journals:
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ from odoo.exceptions import UserError
|
|||||||
from odoo.addons.queue_job.job import job
|
from odoo.addons.queue_job.job import job
|
||||||
from odoo.addons.component.core import Component
|
from odoo.addons.component.core import Component
|
||||||
from odoo.addons.component_event import skip_if
|
from odoo.addons.component_event import skip_if
|
||||||
from odoo.addons import decimal_precision as dp
|
|
||||||
|
|
||||||
|
|
||||||
class ChannelHotelReservation(models.Model):
|
class ChannelHotelReservation(models.Model):
|
||||||
_name = 'channel.hotel.reservation'
|
_name = 'channel.hotel.reservation'
|
||||||
@@ -34,7 +32,7 @@ class ChannelHotelReservation(models.Model):
|
|||||||
default=False)
|
default=False)
|
||||||
|
|
||||||
channel_total_amount = fields.Monetary(string='Channel Total Amount',
|
channel_total_amount = fields.Monetary(string='Channel Total Amount',
|
||||||
readonly=True, digits=dp.get_precision('Product Price'))
|
readonly=True, digits=('Product Price'))
|
||||||
|
|
||||||
# Inherit binding constrain becouse two reservations can have
|
# Inherit binding constrain becouse two reservations can have
|
||||||
# the same external_id
|
# the same external_id
|
||||||
@@ -72,20 +70,20 @@ class ChannelHotelReservation(models.Model):
|
|||||||
return importer.fetch_bookings(dfrom, dto)
|
return importer.fetch_bookings(dfrom, dto)
|
||||||
|
|
||||||
@job(default_channel='root.channel')
|
@job(default_channel='root.channel')
|
||||||
|
|
||||||
def cancel_reservation(self):
|
def cancel_reservation(self):
|
||||||
with self.backend_id.work_on(self._name) as work:
|
with self.backend_id.work_on(self._name) as work:
|
||||||
exporter = work.component(usage='hotel.reservation.exporter')
|
exporter = work.component(usage='hotel.reservation.exporter')
|
||||||
return exporter.cancel_reservation(self)
|
return exporter.cancel_reservation(self)
|
||||||
|
|
||||||
@job(default_channel='root.channel')
|
@job(default_channel='root.channel')
|
||||||
|
|
||||||
def mark_booking(self):
|
def mark_booking(self):
|
||||||
with self.backend_id.work_on(self._name) as work:
|
with self.backend_id.work_on(self._name) as work:
|
||||||
exporter = work.component(usage='hotel.reservation.exporter')
|
exporter = work.component(usage='hotel.reservation.exporter')
|
||||||
return exporter.mark_booking(self)
|
return exporter.mark_booking(self)
|
||||||
|
|
||||||
|
|
||||||
def unlink(self):
|
def unlink(self):
|
||||||
vals = []
|
vals = []
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -116,7 +114,7 @@ class ChannelHotelReservation(models.Model):
|
|||||||
class HotelReservation(models.Model):
|
class HotelReservation(models.Model):
|
||||||
_inherit = 'hotel.reservation'
|
_inherit = 'hotel.reservation'
|
||||||
|
|
||||||
|
|
||||||
def _set_access_for_channel_fields(self):
|
def _set_access_for_channel_fields(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
user = self.env['res.users'].browse(self.env.uid)
|
user = self.env['res.users'].browse(self.env.uid)
|
||||||
@@ -215,7 +213,7 @@ class HotelReservation(models.Model):
|
|||||||
|
|
||||||
return reservation_id
|
return reservation_id
|
||||||
|
|
||||||
|
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
if self._context.get('connector_no_export', True) and \
|
if self._context.get('connector_no_export', True) and \
|
||||||
(vals.get('checkin') or vals.get('checkout') or
|
(vals.get('checkin') or vals.get('checkout') or
|
||||||
@@ -267,7 +265,7 @@ class HotelReservation(models.Model):
|
|||||||
res = super().write(vals)
|
res = super().write(vals)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
def generate_copy_values(self, checkin=False, checkout=False):
|
def generate_copy_values(self, checkin=False, checkout=False):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
res = super().generate_copy_values(checkin=checkin, checkout=checkout)
|
res = super().generate_copy_values(checkin=checkin, checkout=checkout)
|
||||||
@@ -282,7 +280,7 @@ class HotelReservation(models.Model):
|
|||||||
})
|
})
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
def action_reservation_checkout(self):
|
def action_reservation_checkout(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.state != 'cancelled':
|
if record.state != 'cancelled':
|
||||||
@@ -299,7 +297,7 @@ class HotelReservation(models.Model):
|
|||||||
|
|
||||||
return (json_reservs, json_tooltips)
|
return (json_reservs, json_tooltips)
|
||||||
|
|
||||||
|
|
||||||
def mark_as_readed(self):
|
def mark_as_readed(self):
|
||||||
self.write({'to_assign': False})
|
self.write({'to_assign': False})
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
from odoo import api, models, fields, _
|
from odoo import api, models, fields, _
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
from odoo.addons import decimal_precision as dp
|
|
||||||
from odoo.addons.queue_job.job import job
|
from odoo.addons.queue_job.job import job
|
||||||
from odoo.addons.component.core import Component
|
from odoo.addons.component.core import Component
|
||||||
from odoo.addons.component_event import skip_if
|
from odoo.addons.component_event import skip_if
|
||||||
@@ -45,9 +44,9 @@ class ChannelHotelRoomType(models.Model):
|
|||||||
"the maximum simultaneous availability and "
|
"the maximum simultaneous availability and "
|
||||||
"the total room count for the given room type.")
|
"the total room count for the given room type.")
|
||||||
|
|
||||||
min_price = fields.Float('Min. Price', default=5.0, digits=dp.get_precision('Product Price'),
|
min_price = fields.Float('Min. Price', default=5.0, digits=('Product Price'),
|
||||||
help="Setup the min price to prevent incidents while editing your prices.")
|
help="Setup the min price to prevent incidents while editing your prices.")
|
||||||
max_price = fields.Float('Max. Price', default=200.0, digits=dp.get_precision('Product Price'),
|
max_price = fields.Float('Max. Price', default=200.0, digits=('Product Price'),
|
||||||
help="Setup the max price to prevent incidents while editing your prices.")
|
help="Setup the max price to prevent incidents while editing your prices.")
|
||||||
|
|
||||||
@api.constrains('default_quota', 'default_max_avail', 'total_rooms_count')
|
@api.constrains('default_quota', 'default_max_avail', 'total_rooms_count')
|
||||||
@@ -87,7 +86,7 @@ class ChannelHotelRoomType(models.Model):
|
|||||||
raise ValidationError(_("OTA's capacity can't be greater than room type capacity"))
|
raise ValidationError(_("OTA's capacity can't be greater than room type capacity"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@api.constrains('channel_short_code')
|
@api.constrains('channel_short_code')
|
||||||
def _check_channel_short_code(self):
|
def _check_channel_short_code(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -95,7 +94,7 @@ class ChannelHotelRoomType(models.Model):
|
|||||||
raise ValidationError(_("Chanel short code can't be longer than 4 characters"))
|
raise ValidationError(_("Chanel short code can't be longer than 4 characters"))
|
||||||
|
|
||||||
@job(default_channel='root.channel')
|
@job(default_channel='root.channel')
|
||||||
|
|
||||||
def create_room(self):
|
def create_room(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
if not self.external_id:
|
if not self.external_id:
|
||||||
@@ -104,7 +103,7 @@ class ChannelHotelRoomType(models.Model):
|
|||||||
exporter.create_room(self)
|
exporter.create_room(self)
|
||||||
|
|
||||||
@job(default_channel='root.channel')
|
@job(default_channel='root.channel')
|
||||||
|
|
||||||
def modify_room(self):
|
def modify_room(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
if self.external_id:
|
if self.external_id:
|
||||||
@@ -113,7 +112,7 @@ class ChannelHotelRoomType(models.Model):
|
|||||||
exporter.modify_room(self)
|
exporter.modify_room(self)
|
||||||
|
|
||||||
@job(default_channel='root.channel')
|
@job(default_channel='root.channel')
|
||||||
|
|
||||||
def delete_room(self):
|
def delete_room(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
if self.external_id:
|
if self.external_id:
|
||||||
@@ -145,7 +144,7 @@ class HotelRoomType(models.Model):
|
|||||||
_("You can not archive a room type with active rooms.") + " " +
|
_("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))
|
_("Please, change the %s room(s) to other room type.") % str(record.total_rooms_count))
|
||||||
|
|
||||||
|
|
||||||
def get_restrictions(self, date, restriction_plan_id):
|
def get_restrictions(self, date, restriction_plan_id):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
restriction = self.env['hotel.room.type.restriction.item'].search([
|
restriction = self.env['hotel.room.type.restriction.item'].search([
|
||||||
@@ -155,7 +154,7 @@ class HotelRoomType(models.Model):
|
|||||||
], limit=1)
|
], limit=1)
|
||||||
return restriction
|
return restriction
|
||||||
|
|
||||||
|
|
||||||
def open_channel_bind_ids(self):
|
def open_channel_bind_ids(self):
|
||||||
channel_bind_ids = self.mapped('channel_bind_ids')
|
channel_bind_ids = self.mapped('channel_bind_ids')
|
||||||
action = self.env.ref('hotel_channel_connector.channel_hotel_room_type_action').read()[0]
|
action = self.env.ref('hotel_channel_connector.channel_hotel_room_type_action').read()[0]
|
||||||
@@ -176,12 +175,12 @@ class HotelRoomType(models.Model):
|
|||||||
'default_total_rooms_count': self.total_rooms_count}
|
'default_total_rooms_count': self.total_rooms_count}
|
||||||
return action
|
return action
|
||||||
|
|
||||||
|
|
||||||
def disconnect_channel_bind_ids(self):
|
def disconnect_channel_bind_ids(self):
|
||||||
# TODO: multichannel rooms is not implemented
|
# TODO: multichannel rooms is not implemented
|
||||||
self.channel_bind_ids.with_context({'connector_no_export': True}).unlink()
|
self.channel_bind_ids.with_context({'connector_no_export': True}).unlink()
|
||||||
|
|
||||||
|
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
if 'active' in vals and vals.get('active') is False:
|
if 'active' in vals and vals.get('active') is False:
|
||||||
self.channel_bind_ids.unlink()
|
self.channel_bind_ids.unlink()
|
||||||
|
|||||||
@@ -20,7 +20,9 @@
|
|||||||
'mail',
|
'mail',
|
||||||
'account_payment_return',
|
'account_payment_return',
|
||||||
'partner_firstname',
|
'partner_firstname',
|
||||||
'email_template_qweb'
|
'email_template_qweb',
|
||||||
|
'sales_team',
|
||||||
|
'sale'
|
||||||
],
|
],
|
||||||
'data': [
|
'data': [
|
||||||
'security/pms_security.xml',
|
'security/pms_security.xml',
|
||||||
@@ -75,4 +77,4 @@
|
|||||||
'qweb': [
|
'qweb': [
|
||||||
'static/src/xml/pms_base_templates.xml',
|
'static/src/xml/pms_base_templates.xml',
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,17 +3,6 @@
|
|||||||
|
|
||||||
<data noupdate="0">
|
<data noupdate="0">
|
||||||
|
|
||||||
<!-- Scheduler For To Inform Guest About Reservation Before 24 Hours -->
|
|
||||||
<record model="ir.cron" id="Guest_reservation_reminder_24hrs">
|
|
||||||
<field name="name">Inform Guest About Reservation Before 24 Hours</field>
|
|
||||||
<field name="interval_number">1</field>
|
|
||||||
<field name="interval_type">days</field>
|
|
||||||
<field name="numbercall">-1</field>
|
|
||||||
<field name="doall" eval="False" />
|
|
||||||
<field name="model_id" ref="model_pms_reservation" />
|
|
||||||
<field name="code">model.reservation_reminder_24hrs()</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<!-- Scheduler For To Inform Guest About Reservation Before 24 Hours -->
|
<!-- Scheduler For To Inform Guest About Reservation Before 24 Hours -->
|
||||||
<record model="ir.cron" id="autocheckout_reservations">
|
<record model="ir.cron" id="autocheckout_reservations">
|
||||||
<field name="name">Automatic Checkout on past reservations</field>
|
<field name="name">Automatic Checkout on past reservations</field>
|
||||||
@@ -26,7 +15,7 @@
|
|||||||
<field name="model_id" ref="model_pms_reservation" />
|
<field name="model_id" ref="model_pms_reservation" />
|
||||||
<field name="nextcall" eval="(DateTime.now() + timedelta(days=1)).strftime('%Y-%m-%d 05:00:00')"/>
|
<field name="nextcall" eval="(DateTime.now() + timedelta(days=1)).strftime('%Y-%m-%d 05:00:00')"/>
|
||||||
<field name="code">model.autocheckout()</field>
|
<field name="code">model.autocheckout()</field>
|
||||||
|
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<menuitem id="pms_management_menu" name="pms Management"
|
<menuitem id="pms_management_menu" name="PMS Management"
|
||||||
sequence="8" web_icon="pms,static/description/icon.png"
|
sequence="8" web_icon="pms,static/description/icon.png"
|
||||||
groups="pms.group_pms_user,pms.group_pms_call"/>
|
groups="pms.group_pms_user,pms.group_pms_call"/>
|
||||||
|
|
||||||
|
|||||||
@@ -430,7 +430,7 @@
|
|||||||
<!-- pms.room.type -->
|
<!-- pms.room.type -->
|
||||||
|
|
||||||
<record id="demo_pms_room_type_0" model="pms.room.type">
|
<record id="demo_pms_room_type_0" model="pms.room.type">
|
||||||
<field name="pms_id" ref="pms.demo_pms_property"/>
|
<field name="pms_property_id" ref="pms.demo_pms_property"/>
|
||||||
<field name="name">Economic</field>
|
<field name="name">Economic</field>
|
||||||
<field name="code_type">ECO</field>
|
<field name="code_type">ECO</field>
|
||||||
<field name="list_price">21.00</field>
|
<field name="list_price">21.00</field>
|
||||||
@@ -440,7 +440,7 @@
|
|||||||
|
|
||||||
</record>
|
</record>
|
||||||
<record id="demo_pms_room_type_1" model="pms.room.type">
|
<record id="demo_pms_room_type_1" model="pms.room.type">
|
||||||
<field name="pms_id" ref="pms.demo_pms_property"/>
|
<field name="pms_property_id" ref="pms.demo_pms_property"/>
|
||||||
<field name="name">Single</field>
|
<field name="name">Single</field>
|
||||||
<field name="code_type">SNG</field>
|
<field name="code_type">SNG</field>
|
||||||
<field name="list_price">20.00</field>
|
<field name="list_price">20.00</field>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class IrHttp(models.AbstractModel):
|
|||||||
user.company_id = user.pms_property_id.company_id
|
user.company_id = user.pms_property_id.company_id
|
||||||
res['company_id'] = user.pms_property_id.company_id.id
|
res['company_id'] = user.pms_property_id.company_id.id
|
||||||
else:
|
else:
|
||||||
|
return res #TODO Review method
|
||||||
raise MissingError(
|
raise MissingError(
|
||||||
_("Wrong property and company access settings for this user. "
|
_("Wrong property and company access settings for this user. "
|
||||||
"Please review property and company for user %s") % user.name)
|
"Please review property and company for user %s") % user.name)
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# Copyright 2017 Dario Lodeiros
|
# Copyright 2017 Dario Lodeiros
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
from odoo import api, models, fields
|
from odoo import api, models, fields
|
||||||
from odoo.addons import decimal_precision as dp
|
|
||||||
|
|
||||||
|
|
||||||
class PmsBoardService(models.Model):
|
class PmsBoardService(models.Model):
|
||||||
@@ -9,40 +8,31 @@ class PmsBoardService(models.Model):
|
|||||||
_description = "Board Services"
|
_description = "Board Services"
|
||||||
|
|
||||||
# Fields declaration
|
# Fields declaration
|
||||||
name = fields.Char(
|
name = fields.Char("Board Name", translate=True, size=64, required=True, index=True)
|
||||||
'Board Name',
|
|
||||||
translate=True,
|
|
||||||
size=64,
|
|
||||||
required=True,
|
|
||||||
index=True)
|
|
||||||
board_service_line_ids = fields.One2many(
|
board_service_line_ids = fields.One2many(
|
||||||
'pms.board.service.line',
|
"pms.board.service.line", "pms_board_service_id"
|
||||||
'pms_board_service_id')
|
)
|
||||||
pms_property_ids = fields.Many2many(
|
pms_property_ids = fields.Many2many(
|
||||||
'pms.property',
|
"pms.property", string="Properties", required=False, ondelete="restrict"
|
||||||
string='Properties',
|
)
|
||||||
required=False,
|
|
||||||
ondelete='restrict')
|
|
||||||
pms_board_service_room_type_ids = fields.One2many(
|
pms_board_service_room_type_ids = fields.One2many(
|
||||||
'pms.board.service.room.type',
|
"pms.board.service.room.type", "pms_board_service_id"
|
||||||
'pms_board_service_id')
|
)
|
||||||
price_type = fields.Selection([
|
price_type = fields.Selection(
|
||||||
('fixed', 'Fixed'),
|
[("fixed", "Fixed"), ("percent", "Percent")],
|
||||||
('percent', 'Percent')],
|
string="Type",
|
||||||
string='Type',
|
default="fixed",
|
||||||
default='fixed',
|
required=True,
|
||||||
required=True)
|
)
|
||||||
amount = fields.Float(
|
amount = fields.Float(
|
||||||
'Amount',
|
"Amount", digits=("Product Price"), compute="_compute_board_amount", store=True
|
||||||
digits=dp.get_precision('Product Price'),
|
)
|
||||||
compute='_compute_board_amount',
|
|
||||||
store=True)
|
|
||||||
|
|
||||||
# Compute and Search methods
|
# Compute and Search methods
|
||||||
@api.depends('board_service_line_ids.amount')
|
@api.depends("board_service_line_ids.amount")
|
||||||
def _compute_board_amount(self):
|
def _compute_board_amount(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
total = 0
|
total = 0
|
||||||
for service in record.board_service_line_ids:
|
for service in record.board_service_line_ids:
|
||||||
total += service.amount
|
total += service.amount
|
||||||
record.update({'amount': total})
|
record.update({"amount": total})
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
# Copyright 2017 Dario Lodeiros
|
# Copyright 2017 Dario Lodeiros
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
from odoo import api, fields, models
|
from odoo import api, fields, models
|
||||||
from odoo.addons import decimal_precision as dp
|
|
||||||
|
|
||||||
|
|
||||||
class PmsBoardServiceLine(models.Model):
|
class PmsBoardServiceLine(models.Model):
|
||||||
_name = 'pms.board.service.line'
|
_name = "pms.board.service.line"
|
||||||
_description = 'Services on Board Service included'
|
_description = "Services on Board Service included"
|
||||||
|
|
||||||
# Default methods
|
# Default methods
|
||||||
def _get_default_price(self):
|
def _get_default_price(self):
|
||||||
@@ -15,24 +14,18 @@ class PmsBoardServiceLine(models.Model):
|
|||||||
|
|
||||||
# Fields declaration
|
# Fields declaration
|
||||||
pms_board_service_id = fields.Many2one(
|
pms_board_service_id = fields.Many2one(
|
||||||
'pms.board.service',
|
"pms.board.service", "Board Service", ondelete="cascade", required=True
|
||||||
'Board Service',
|
)
|
||||||
ondelete='cascade',
|
product_id = fields.Many2one("product.product", string="Product", required=True)
|
||||||
required=True)
|
|
||||||
product_id = fields.Many2one(
|
|
||||||
'product.product',
|
|
||||||
string='Product',
|
|
||||||
required=True)
|
|
||||||
pms_property_ids = fields.Many2many(
|
pms_property_ids = fields.Many2many(
|
||||||
'pms.property',
|
"pms.property", related="pms_board_service_id.pms_property_ids"
|
||||||
related='pms_board_service_id.pms_property_ids')
|
)
|
||||||
amount = fields.Float(
|
amount = fields.Float(
|
||||||
'Amount',
|
"Amount", digits=("Product Price"), default=_get_default_price
|
||||||
digits=dp.get_precision('Product Price'),
|
)
|
||||||
default=_get_default_price)
|
|
||||||
|
|
||||||
# Constraints and onchanges
|
# Constraints and onchanges
|
||||||
@api.onchange('product_id')
|
@api.onchange("product_id")
|
||||||
def onchange_product_id(self):
|
def onchange_product_id(self):
|
||||||
if self.product_id:
|
if self.product_id:
|
||||||
self.update({'amount': self.product_id.list_price})
|
self.update({"amount": self.product_id.list_price})
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# Copyright 2017 Dario
|
# Copyright 2017 Dario
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
from odoo import api, fields, models, _
|
from odoo import api, fields, models, _
|
||||||
from odoo.addons import decimal_precision as dp
|
|
||||||
from odoo.exceptions import UserError
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
|
|
||||||
@@ -13,7 +12,7 @@ class PmsBoardServiceRoomType(models.Model):
|
|||||||
_description = 'Board Service included in Room'
|
_description = 'Board Service included in Room'
|
||||||
|
|
||||||
# Default Methods ang Gets
|
# Default Methods ang Gets
|
||||||
|
|
||||||
def name_get(self):
|
def name_get(self):
|
||||||
result = []
|
result = []
|
||||||
for res in self:
|
for res in self:
|
||||||
@@ -58,7 +57,7 @@ class PmsBoardServiceRoomType(models.Model):
|
|||||||
required=True)
|
required=True)
|
||||||
amount = fields.Float(
|
amount = fields.Float(
|
||||||
'Amount',
|
'Amount',
|
||||||
digits=dp.get_precision('Product Price'),
|
digits=('Product Price'),
|
||||||
compute='_compute_board_amount',
|
compute='_compute_board_amount',
|
||||||
store=True)
|
store=True)
|
||||||
|
|
||||||
@@ -100,7 +99,7 @@ class PmsBoardServiceRoomType(models.Model):
|
|||||||
can't repeat without pricelist"))
|
can't repeat without pricelist"))
|
||||||
|
|
||||||
# Action methods
|
# Action methods
|
||||||
|
|
||||||
def open_board_lines_form(self):
|
def open_board_lines_form(self):
|
||||||
action = self.env.ref(
|
action = self.env.ref(
|
||||||
'pms.action_pms_board_service_room_type_view').read()[0]
|
'pms.action_pms_board_service_room_type_view').read()[0]
|
||||||
@@ -130,7 +129,7 @@ class PmsBoardServiceRoomType(models.Model):
|
|||||||
)
|
)
|
||||||
return super(PmsBoardServiceRoomType, self).create(vals)
|
return super(PmsBoardServiceRoomType, self).create(vals)
|
||||||
|
|
||||||
|
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
if 'pms_board_service_id' in vals:
|
if 'pms_board_service_id' in vals:
|
||||||
vals.update(
|
vals.update(
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
# Copyright 2017 Dario Lodeiros
|
# Copyright 2017 Dario Lodeiros
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
from odoo import fields, models
|
from odoo import fields, models
|
||||||
from odoo.addons import decimal_precision as dp
|
|
||||||
|
|
||||||
|
|
||||||
class PmsBoardServiceRoomTypeLine(models.Model):
|
class PmsBoardServiceRoomTypeLine(models.Model):
|
||||||
_name = 'pms.board.service.room.type.line'
|
_name = 'pms.board.service.room.type.line'
|
||||||
@@ -20,5 +18,4 @@ class PmsBoardServiceRoomTypeLine(models.Model):
|
|||||||
required=True,
|
required=True,
|
||||||
readonly=True)
|
readonly=True)
|
||||||
# TODO def default_amount "amount of service"
|
# TODO def default_amount "amount of service"
|
||||||
amount = fields.Float('Amount', digits=dp.get_precision(
|
amount = fields.Float('Amount', digits=('Product Price'), default=0.0)
|
||||||
'Product Price'), default=0.0)
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ from odoo.tools import (
|
|||||||
|
|
||||||
class PmsCheckinPartner(models.Model):
|
class PmsCheckinPartner(models.Model):
|
||||||
_name = 'pms.checkin.partner'
|
_name = 'pms.checkin.partner'
|
||||||
|
_description = 'Partner Checkins'
|
||||||
|
|
||||||
# Default Methods ang Gets
|
# Default Methods ang Gets
|
||||||
def _default_reservation_id(self):
|
def _default_reservation_id(self):
|
||||||
@@ -111,7 +112,7 @@ class PmsCheckinPartner(models.Model):
|
|||||||
track_visibility='onchange')
|
track_visibility='onchange')
|
||||||
|
|
||||||
# Constraints and onchanges
|
# Constraints and onchanges
|
||||||
|
|
||||||
@api.constrains('exit_date', 'enter_date')
|
@api.constrains('exit_date', 'enter_date')
|
||||||
def _check_exit_date(self):
|
def _check_exit_date(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -133,7 +134,7 @@ class PmsCheckinPartner(models.Model):
|
|||||||
_('Departure date, is prior to arrival. Check it now. %s') %
|
_('Departure date, is prior to arrival. Check it now. %s') %
|
||||||
date_out)
|
date_out)
|
||||||
|
|
||||||
|
|
||||||
@api.onchange('partner_id')
|
@api.onchange('partner_id')
|
||||||
def _check_partner_id(self):
|
def _check_partner_id(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -152,7 +153,7 @@ class PmsCheckinPartner(models.Model):
|
|||||||
_('This guest is already registered in the room'))
|
_('This guest is already registered in the room'))
|
||||||
|
|
||||||
# Action methods
|
# Action methods
|
||||||
|
|
||||||
def action_on_board(self):
|
def action_on_board(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.reservation_id.checkin > fields.Date.today():
|
if record.reservation_id.checkin > fields.Date.today():
|
||||||
@@ -185,7 +186,7 @@ class PmsCheckinPartner(models.Model):
|
|||||||
"type": "ir.actions.do_nothing",
|
"type": "ir.actions.do_nothing",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def action_done(self):
|
def action_done(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.state == 'booking':
|
if record.state == 'booking':
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ class PmsFolio(models.Model):
|
|||||||
move_ids = folio.reservation_ids.mapped('move_line_ids').\
|
move_ids = folio.reservation_ids.mapped('move_line_ids').\
|
||||||
mapped('move_id').filtered(lambda r: r.type in [
|
mapped('move_id').filtered(lambda r: r.type in [
|
||||||
'out_invoice', 'out_refund'])
|
'out_invoice', 'out_refund'])
|
||||||
invoice_ids |= folio.service_ids.mapped('move_line_ids').mapped(
|
invoice_ids = folio.service_ids.mapped('move_line_ids').mapped(
|
||||||
'move_id').filtered(lambda r: r.type in [
|
'move_id').filtered(lambda r: r.type in [
|
||||||
'out_invoice', 'out_refund'])
|
'out_invoice', 'out_refund'])
|
||||||
# TODO: Search for invoices which have been 'cancelled'
|
# TODO: Search for invoices which have been 'cancelled'
|
||||||
@@ -290,7 +290,7 @@ class PmsFolio(models.Model):
|
|||||||
# use like as origin may contains multiple references
|
# use like as origin may contains multiple references
|
||||||
# (e.g. 'SO01, SO02')
|
# (e.g. 'SO01, SO02')
|
||||||
refunds = invoice_ids.search([
|
refunds = invoice_ids.search([
|
||||||
('origin', 'like', folio.name),
|
('invoice_origin', 'like', folio.name),
|
||||||
('company_id', '=', folio.company_id.id)]).filtered(
|
('company_id', '=', folio.company_id.id)]).filtered(
|
||||||
lambda r: r.type in ['out_invoice', 'out_refund'])
|
lambda r: r.type in ['out_invoice', 'out_refund'])
|
||||||
invoice_ids |= refunds.filtered(
|
invoice_ids |= refunds.filtered(
|
||||||
@@ -301,8 +301,8 @@ class PmsFolio(models.Model):
|
|||||||
for inv in invoice_ids:
|
for inv in invoice_ids:
|
||||||
refund_ids += refund_ids.search([
|
refund_ids += refund_ids.search([
|
||||||
('type', '=', 'out_refund'),
|
('type', '=', 'out_refund'),
|
||||||
('origin', '=', inv.number),
|
('invoice_origin', '=', inv.number),
|
||||||
('origin', '!=', False),
|
('invoice_origin', '!=', False),
|
||||||
('journal_id', '=', inv.journal_id.id)])
|
('journal_id', '=', inv.journal_id.id)])
|
||||||
# Ignore the status of the deposit product
|
# Ignore the status of the deposit product
|
||||||
deposit_product_id = self.env['sale.advance.payment.inv'].\
|
deposit_product_id = self.env['sale.advance.payment.inv'].\
|
||||||
@@ -331,7 +331,7 @@ class PmsFolio(models.Model):
|
|||||||
|
|
||||||
folio.update({
|
folio.update({
|
||||||
'invoice_count': len(set(move_ids.ids + refund_ids.ids)),
|
'invoice_count': len(set(move_ids.ids + refund_ids.ids)),
|
||||||
'invoice_ids': move_ids.ids + refund_ids.ids,
|
'move_ids': move_ids.ids + refund_ids.ids,
|
||||||
'invoice_status': invoice_status
|
'invoice_status': invoice_status
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -357,7 +357,7 @@ class PmsFolio(models.Model):
|
|||||||
|
|
||||||
@api.depends('amount_total', 'payment_ids', 'return_ids',
|
@api.depends('amount_total', 'payment_ids', 'return_ids',
|
||||||
'reservation_type', 'state')
|
'reservation_type', 'state')
|
||||||
|
|
||||||
def compute_amount(self):
|
def compute_amount(self):
|
||||||
acc_pay_obj = self.env['account.payment']
|
acc_pay_obj = self.env['account.payment']
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -466,7 +466,7 @@ class PmsFolio(models.Model):
|
|||||||
self.has_checkout_to_send = False
|
self.has_checkout_to_send = False
|
||||||
|
|
||||||
# Constraints and onchanges
|
# Constraints and onchanges
|
||||||
|
|
||||||
@api.onchange('partner_id')
|
@api.onchange('partner_id')
|
||||||
def onchange_partner_id(self):
|
def onchange_partner_id(self):
|
||||||
"""
|
"""
|
||||||
@@ -484,7 +484,7 @@ class PmsFolio(models.Model):
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
|
||||||
addr = self.partner_id.address_get(['move'])
|
addr = self.partner_id.address_get(['invoice'])
|
||||||
pricelist = self.partner_id.property_product_pricelist and \
|
pricelist = self.partner_id.property_product_pricelist and \
|
||||||
self.partner_id.property_product_pricelist.id or \
|
self.partner_id.property_product_pricelist.id or \
|
||||||
self.env.user.pms_property_id.default_pricelist_id.id
|
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
|
values['team_id'] = self.partner_id.team_id.id
|
||||||
self.update(values)
|
self.update(values)
|
||||||
|
|
||||||
|
|
||||||
@api.onchange('pricelist_id')
|
@api.onchange('pricelist_id')
|
||||||
def onchange_pricelist_id(self):
|
def onchange_pricelist_id(self):
|
||||||
values = {'reservation_type': self.env['pms.folio'].
|
values = {'reservation_type': self.env['pms.folio'].
|
||||||
@@ -517,7 +517,7 @@ class PmsFolio(models.Model):
|
|||||||
self.update(values)
|
self.update(values)
|
||||||
|
|
||||||
# Action methods
|
# Action methods
|
||||||
|
|
||||||
def action_pay(self):
|
def action_pay(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
partner = self.partner_id.id
|
partner = self.partner_id.id
|
||||||
@@ -541,7 +541,7 @@ class PmsFolio(models.Model):
|
|||||||
'target': 'new',
|
'target': 'new',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def open_moves_folio(self):
|
def open_moves_folio(self):
|
||||||
invoices = self.mapped('move_ids')
|
invoices = self.mapped('move_ids')
|
||||||
action = self.env.ref('account.action_move_out_invoice_type').read()[0]
|
action = self.env.ref('account.action_move_out_invoice_type').read()[0]
|
||||||
@@ -555,7 +555,7 @@ class PmsFolio(models.Model):
|
|||||||
action = {'type': 'ir.actions.act_window_close'}
|
action = {'type': 'ir.actions.act_window_close'}
|
||||||
return action
|
return action
|
||||||
|
|
||||||
|
|
||||||
def action_return_payments(self):
|
def action_return_payments(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
return_move_ids = []
|
return_move_ids = []
|
||||||
@@ -582,7 +582,7 @@ class PmsFolio(models.Model):
|
|||||||
'domain': [('id', 'in', return_move_ids)],
|
'domain': [('id', 'in', return_move_ids)],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def action_checks(self):
|
def action_checks(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
rooms = self.mapped('reservation_ids.id')
|
rooms = self.mapped('reservation_ids.id')
|
||||||
@@ -596,7 +596,7 @@ class PmsFolio(models.Model):
|
|||||||
'target': 'new',
|
'target': 'new',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def send_reservation_mail(self):
|
def send_reservation_mail(self):
|
||||||
'''
|
'''
|
||||||
This function opens a window to compose an email,
|
This function opens a window to compose an email,
|
||||||
@@ -642,7 +642,7 @@ class PmsFolio(models.Model):
|
|||||||
'force_send': True
|
'force_send': True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def send_exit_mail(self):
|
def send_exit_mail(self):
|
||||||
'''
|
'''
|
||||||
This function opens a window to compose an email,
|
This function opens a window to compose an email,
|
||||||
@@ -688,7 +688,7 @@ class PmsFolio(models.Model):
|
|||||||
'force_send': True
|
'force_send': True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def send_cancel_mail(self):
|
def send_cancel_mail(self):
|
||||||
'''
|
'''
|
||||||
This function opens a window to compose an email,
|
This function opens a window to compose an email,
|
||||||
@@ -773,14 +773,14 @@ class PmsFolio(models.Model):
|
|||||||
else:
|
else:
|
||||||
return 'normal'
|
return 'normal'
|
||||||
|
|
||||||
|
|
||||||
def action_done(self):
|
def action_done(self):
|
||||||
reservation_ids = self.mapped('reservation_ids')
|
reservation_ids = self.mapped('reservation_ids')
|
||||||
for line in reservation_ids:
|
for line in reservation_ids:
|
||||||
if line.state == "booking":
|
if line.state == "booking":
|
||||||
line.action_reservation_checkout()
|
line.action_reservation_checkout()
|
||||||
|
|
||||||
|
|
||||||
def action_cancel(self):
|
def action_cancel(self):
|
||||||
for folio in self:
|
for folio in self:
|
||||||
for reservation in folio.reservation_ids.filtered(
|
for reservation in folio.reservation_ids.filtered(
|
||||||
@@ -791,7 +791,7 @@ class PmsFolio(models.Model):
|
|||||||
})
|
})
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def action_confirm(self):
|
def action_confirm(self):
|
||||||
for folio in self.filtered(lambda folio: folio.partner_id not in
|
for folio in self.filtered(lambda folio: folio.partner_id not in
|
||||||
folio.message_partner_ids):
|
folio.message_partner_ids):
|
||||||
@@ -814,7 +814,7 @@ class PmsFolio(models.Model):
|
|||||||
CHECKIN/OUT PROCESS
|
CHECKIN/OUT PROCESS
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def _compute_checkin_partner_count(self):
|
def _compute_checkin_partner_count(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.reservation_type == 'normal' and record.reservation_ids:
|
if record.reservation_type == 'normal' and record.reservation_ids:
|
||||||
@@ -830,7 +830,7 @@ class PmsFolio(models.Model):
|
|||||||
record.checkin_partner_pending_count = sum(
|
record.checkin_partner_pending_count = sum(
|
||||||
mapped_checkin_partner_count)
|
mapped_checkin_partner_count)
|
||||||
|
|
||||||
|
|
||||||
def get_grouped_reservations_json(self, state, import_all=False):
|
def get_grouped_reservations_json(self, state, import_all=False):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
info_grouped = []
|
info_grouped = []
|
||||||
@@ -873,7 +873,7 @@ class PmsFolio(models.Model):
|
|||||||
reverse=True),
|
reverse=True),
|
||||||
key=lambda k: k['room_type']['id'])
|
key=lambda k: k['room_type']['id'])
|
||||||
|
|
||||||
|
|
||||||
def _get_tax_amount_by_group(self):
|
def _get_tax_amount_by_group(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
res = {}
|
res = {}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ from odoo.tools import (
|
|||||||
DEFAULT_SERVER_DATE_FORMAT,
|
DEFAULT_SERVER_DATE_FORMAT,
|
||||||
DEFAULT_SERVER_DATETIME_FORMAT)
|
DEFAULT_SERVER_DATETIME_FORMAT)
|
||||||
from odoo import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
from odoo.addons import decimal_precision as dp
|
|
||||||
import logging
|
import logging
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -301,24 +300,24 @@ class PmsReservation(models.Model):
|
|||||||
string='To Invoice',
|
string='To Invoice',
|
||||||
store=True,
|
store=True,
|
||||||
readonly=True,
|
readonly=True,
|
||||||
digits=dp.get_precision('Product Unit of Measure'))
|
digits=('Product Unit of Measure'))
|
||||||
qty_invoiced = fields.Float(
|
qty_invoiced = fields.Float(
|
||||||
compute='_get_invoice_qty',
|
compute='_get_invoice_qty',
|
||||||
string='Invoiced',
|
string='Invoiced',
|
||||||
store=True,
|
store=True,
|
||||||
readonly=True,
|
readonly=True,
|
||||||
digits=dp.get_precision('Product Unit of Measure'))
|
digits=('Product Unit of Measure'))
|
||||||
price_subtotal = fields.Monetary(
|
price_subtotal = fields.Monetary(
|
||||||
string='Subtotal',
|
string='Subtotal',
|
||||||
readonly=True,
|
readonly=True,
|
||||||
store=True,
|
store=True,
|
||||||
digits=dp.get_precision('Product Price'),
|
digits=('Product Price'),
|
||||||
compute='_compute_amount_reservation')
|
compute='_compute_amount_reservation')
|
||||||
price_total = fields.Monetary(
|
price_total = fields.Monetary(
|
||||||
string='Total',
|
string='Total',
|
||||||
readonly=True,
|
readonly=True,
|
||||||
store=True,
|
store=True,
|
||||||
digits=dp.get_precision('Product Price'),
|
digits=('Product Price'),
|
||||||
compute='_compute_amount_reservation')
|
compute='_compute_amount_reservation')
|
||||||
price_tax = fields.Float(
|
price_tax = fields.Float(
|
||||||
string='Taxes',
|
string='Taxes',
|
||||||
@@ -329,17 +328,17 @@ class PmsReservation(models.Model):
|
|||||||
string='Services Total',
|
string='Services Total',
|
||||||
readonly=True,
|
readonly=True,
|
||||||
store=True,
|
store=True,
|
||||||
digits=dp.get_precision('Product Price'),
|
digits=('Product Price'),
|
||||||
compute='_compute_amount_room_services')
|
compute='_compute_amount_room_services')
|
||||||
price_room_services_set = fields.Monetary(
|
price_room_services_set = fields.Monetary(
|
||||||
string='Room Services Total',
|
string='Room Services Total',
|
||||||
readonly=True,
|
readonly=True,
|
||||||
store=True,
|
store=True,
|
||||||
digits=dp.get_precision('Product Price'),
|
digits=('Product Price'),
|
||||||
compute='_compute_amount_set')
|
compute='_compute_amount_set')
|
||||||
discount = fields.Float(
|
discount = fields.Float(
|
||||||
string='Discount (€)',
|
string='Discount (€)',
|
||||||
digits=dp.get_precision('Discount'),
|
digits=('Discount'),
|
||||||
compute='_compute_discount',
|
compute='_compute_discount',
|
||||||
store=True)
|
store=True)
|
||||||
|
|
||||||
@@ -419,10 +418,11 @@ class PmsReservation(models.Model):
|
|||||||
def _compute_localizator(self):
|
def _compute_localizator(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.folio_id:
|
if record.folio_id:
|
||||||
|
#TODO: Review Datetime type no char v13
|
||||||
localizator = re.sub("[^0-9]", "", record.folio_id.name)
|
localizator = re.sub("[^0-9]", "", record.folio_id.name)
|
||||||
checkout = int(re.sub("[^0-9]", "", record.checkout))
|
# checkout = int(re.sub("[^0-9]", "", record.checkout))
|
||||||
checkin = int(re.sub("[^0-9]", "", record.checkin))
|
# checkin = int(re.sub("[^0-9]", "", record.checkin))
|
||||||
localizator += str((checkin + checkout) % 99)
|
# localizator += str((checkin + checkout) % 99)
|
||||||
record.localizator = localizator
|
record.localizator = localizator
|
||||||
|
|
||||||
@api.depends('service_ids.price_total')
|
@api.depends('service_ids.price_total')
|
||||||
@@ -512,7 +512,7 @@ class PmsReservation(models.Model):
|
|||||||
reservation period: %s ') % occupied_name
|
reservation period: %s ') % occupied_name
|
||||||
raise ValidationError(warning_msg)
|
raise ValidationError(warning_msg)
|
||||||
|
|
||||||
|
|
||||||
@api.constrains('checkin_partner_ids')
|
@api.constrains('checkin_partner_ids')
|
||||||
def _max_checkin_partner_ids(self):
|
def _max_checkin_partner_ids(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -554,7 +554,7 @@ class PmsReservation(models.Model):
|
|||||||
}
|
}
|
||||||
self.update(values)
|
self.update(values)
|
||||||
|
|
||||||
|
|
||||||
@api.onchange('pricelist_id')
|
@api.onchange('pricelist_id')
|
||||||
def onchange_pricelist_id(self):
|
def onchange_pricelist_id(self):
|
||||||
values = {'reservation_type': self.env['pms.folio'].
|
values = {'reservation_type': self.env['pms.folio'].
|
||||||
@@ -569,7 +569,7 @@ class PmsReservation(models.Model):
|
|||||||
self.update({'partner_id':
|
self.update({'partner_id':
|
||||||
self.env.user.company_id.partner_id.id})
|
self.env.user.company_id.partner_id.id})
|
||||||
|
|
||||||
|
|
||||||
@api.onchange('checkin_partner_ids')
|
@api.onchange('checkin_partner_ids')
|
||||||
def onchange_checkin_partner_ids(self):
|
def onchange_checkin_partner_ids(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -640,7 +640,7 @@ class PmsReservation(models.Model):
|
|||||||
for service in services:
|
for service in services:
|
||||||
service.onchange_product_id()
|
service.onchange_product_id()
|
||||||
|
|
||||||
|
|
||||||
@api.onchange('checkin', 'checkout', 'room_id')
|
@api.onchange('checkin', 'checkout', 'room_id')
|
||||||
def onchange_room_availabiltiy_domain(self):
|
def onchange_room_availabiltiy_domain(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
@@ -704,7 +704,7 @@ class PmsReservation(models.Model):
|
|||||||
service.price_unit = service._compute_price_unit()
|
service.price_unit = service._compute_price_unit()
|
||||||
|
|
||||||
# Action methods
|
# Action methods
|
||||||
|
|
||||||
def open_invoices_reservation(self):
|
def open_invoices_reservation(self):
|
||||||
invoices = self.folio_id.mapped('move_ids')
|
invoices = self.folio_id.mapped('move_ids')
|
||||||
action = self.env.ref('account.action_move_out_invoice_type').read()[0]
|
action = self.env.ref('account.action_move_out_invoice_type').read()[0]
|
||||||
@@ -721,7 +721,7 @@ class PmsReservation(models.Model):
|
|||||||
'default_folio_id': self.folio_id.id}
|
'default_folio_id': self.folio_id.id}
|
||||||
return action
|
return action
|
||||||
|
|
||||||
|
|
||||||
def create_invoice(self):
|
def create_invoice(self):
|
||||||
action = self.env.ref(
|
action = self.env.ref(
|
||||||
'pms.action_view_folio_advance_payment_inv').read()[0]
|
'pms.action_view_folio_advance_payment_inv').read()[0]
|
||||||
@@ -729,7 +729,7 @@ class PmsReservation(models.Model):
|
|||||||
'default_folio_id': self.folio_id.id}
|
'default_folio_id': self.folio_id.id}
|
||||||
return action
|
return action
|
||||||
|
|
||||||
|
|
||||||
def open_folio(self):
|
def open_folio(self):
|
||||||
action = self.env.ref(
|
action = self.env.ref(
|
||||||
'pms.open_pms_folio1_form_tree_all').read()[0]
|
'pms.open_pms_folio1_form_tree_all').read()[0]
|
||||||
@@ -741,7 +741,7 @@ class PmsReservation(models.Model):
|
|||||||
action = {'type': 'ir.actions.act_window_close'}
|
action = {'type': 'ir.actions.act_window_close'}
|
||||||
return action
|
return action
|
||||||
|
|
||||||
|
|
||||||
def open_reservation_form(self):
|
def open_reservation_form(self):
|
||||||
action = self.env.ref(
|
action = self.env.ref(
|
||||||
'pms.open_pms_reservation_form_tree_all').read()[0]
|
'pms.open_pms_reservation_form_tree_all').read()[0]
|
||||||
@@ -750,12 +750,12 @@ class PmsReservation(models.Model):
|
|||||||
action['res_id'] = self.id
|
action['res_id'] = self.id
|
||||||
return action
|
return action
|
||||||
|
|
||||||
|
|
||||||
def action_pay_folio(self):
|
def action_pay_folio(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
return self.folio_id.action_pay()
|
return self.folio_id.action_pay()
|
||||||
|
|
||||||
|
|
||||||
def action_pay_reservation(self):
|
def action_pay_reservation(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
partner = self.partner_id.id
|
partner = self.partner_id.id
|
||||||
@@ -795,7 +795,7 @@ class PmsReservation(models.Model):
|
|||||||
return super(PmsReservation, self).name_search(
|
return super(PmsReservation, self).name_search(
|
||||||
name='', args=args, operator='ilike', limit=limit)
|
name='', args=args, operator='ilike', limit=limit)
|
||||||
|
|
||||||
|
|
||||||
def name_get(self):
|
def name_get(self):
|
||||||
result = []
|
result = []
|
||||||
for res in self:
|
for res in self:
|
||||||
@@ -853,7 +853,7 @@ class PmsReservation(models.Model):
|
|||||||
record.confirm()
|
record.confirm()
|
||||||
return record
|
return record
|
||||||
|
|
||||||
|
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
if self.notify_update(vals):
|
if self.notify_update(vals):
|
||||||
vals.update({
|
vals.update({
|
||||||
@@ -937,7 +937,7 @@ class PmsReservation(models.Model):
|
|||||||
return record
|
return record
|
||||||
|
|
||||||
# Business methods
|
# Business methods
|
||||||
|
|
||||||
def _computed_shared(self):
|
def _computed_shared(self):
|
||||||
# Has this reservation more charges associates in folio?,
|
# Has this reservation more charges associates in folio?,
|
||||||
# Yes?, then, this is share folio ;)
|
# Yes?, then, this is share folio ;)
|
||||||
@@ -948,7 +948,7 @@ class PmsReservation(models.Model):
|
|||||||
or any(record.folio_id.service_ids.filtered(
|
or any(record.folio_id.service_ids.filtered(
|
||||||
lambda x: x.reservation_id.id != record.id))
|
lambda x: x.reservation_id.id != record.id))
|
||||||
|
|
||||||
|
|
||||||
def compute_board_services(self, vals):
|
def compute_board_services(self, vals):
|
||||||
"""
|
"""
|
||||||
We must compute service_ids when we have a board_service_id without
|
We must compute service_ids when we have a board_service_id without
|
||||||
@@ -963,7 +963,7 @@ class PmsReservation(models.Model):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def compute_qty_service_day(self, vals):
|
def compute_qty_service_day(self, vals):
|
||||||
"""
|
"""
|
||||||
Compute if it is necesary calc price in write/create
|
Compute if it is necesary calc price in write/create
|
||||||
@@ -1047,7 +1047,7 @@ class PmsReservation(models.Model):
|
|||||||
subtype='mt_comment', body=msg)
|
subtype='mt_comment', body=msg)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def notify_update(self, vals):
|
def notify_update(self, vals):
|
||||||
if 'checkin' in vals or \
|
if 'checkin' in vals or \
|
||||||
'checkout' in vals or \
|
'checkout' in vals or \
|
||||||
@@ -1058,12 +1058,12 @@ class PmsReservation(models.Model):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def overbooking_button(self):
|
def overbooking_button(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
self.overbooking = not self.overbooking
|
self.overbooking = not self.overbooking
|
||||||
|
|
||||||
|
|
||||||
def generate_copy_values(self, checkin=False, checkout=False):
|
def generate_copy_values(self, checkin=False, checkout=False):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
return {
|
return {
|
||||||
@@ -1091,7 +1091,7 @@ class PmsReservation(models.Model):
|
|||||||
STATE WORKFLOW -----------------------------------------------------
|
STATE WORKFLOW -----------------------------------------------------
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def confirm(self):
|
def confirm(self):
|
||||||
'''
|
'''
|
||||||
@param self: object pointer
|
@param self: object pointer
|
||||||
@@ -1130,7 +1130,7 @@ class PmsReservation(models.Model):
|
|||||||
splitted_reservs.confirm()
|
splitted_reservs.confirm()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def button_done(self):
|
def button_done(self):
|
||||||
'''
|
'''
|
||||||
@param self: object pointer
|
@param self: object pointer
|
||||||
@@ -1139,7 +1139,7 @@ class PmsReservation(models.Model):
|
|||||||
record.action_reservation_checkout()
|
record.action_reservation_checkout()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def action_cancel(self):
|
def action_cancel(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
cancel_reason = 'intime' if self._context.get(
|
cancel_reason = 'intime' if self._context.get(
|
||||||
@@ -1166,7 +1166,7 @@ class PmsReservation(models.Model):
|
|||||||
splitted_reservs.action_cancel()
|
splitted_reservs.action_cancel()
|
||||||
record.folio_id.compute_amount()
|
record.folio_id.compute_amount()
|
||||||
|
|
||||||
|
|
||||||
def compute_cancelation_reason(self):
|
def compute_cancelation_reason(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
pricelist = self.pricelist_id
|
pricelist = self.pricelist_id
|
||||||
@@ -1184,7 +1184,7 @@ class PmsReservation(models.Model):
|
|||||||
return 'intime'
|
return 'intime'
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def draft(self):
|
def draft(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
record.state = 'draft'
|
record.state = 'draft'
|
||||||
@@ -1207,7 +1207,7 @@ class PmsReservation(models.Model):
|
|||||||
"""
|
"""
|
||||||
PRICE PROCESS ------------------------------------------------------
|
PRICE PROCESS ------------------------------------------------------
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def compute_price_out_vals(self, vals):
|
def compute_price_out_vals(self, vals):
|
||||||
"""
|
"""
|
||||||
Compute if It is necesary calc price in write/create
|
Compute if It is necesary calc price in write/create
|
||||||
@@ -1220,7 +1220,7 @@ class PmsReservation(models.Model):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def _compute_cancelled_discount(self):
|
def _compute_cancelled_discount(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
pricelist = self.pricelist_id
|
pricelist = self.pricelist_id
|
||||||
@@ -1378,7 +1378,7 @@ class PmsReservation(models.Model):
|
|||||||
CHECKIN/OUT PROCESS ------------------------------------------------
|
CHECKIN/OUT PROCESS ------------------------------------------------
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def _compute_checkin_partner_count(self):
|
def _compute_checkin_partner_count(self):
|
||||||
_logger.info('_compute_checkin_partner_count')
|
_logger.info('_compute_checkin_partner_count')
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -1392,14 +1392,14 @@ class PmsReservation(models.Model):
|
|||||||
record.checkin_partner_pending_count = 0
|
record.checkin_partner_pending_count = 0
|
||||||
|
|
||||||
# https://www.odoo.com/es_ES/forum/ayuda-1/question/calculated-fields-in-search-filter-possible-118501
|
# https://www.odoo.com/es_ES/forum/ayuda-1/question/calculated-fields-in-search-filter-possible-118501
|
||||||
|
|
||||||
def _search_checkin_partner_pending(self, operator, value):
|
def _search_checkin_partner_pending(self, operator, value):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
recs = self.search([]).filtered(
|
recs = self.search([]).filtered(
|
||||||
lambda x: x.checkin_partner_pending_count > 0)
|
lambda x: x.checkin_partner_pending_count > 0)
|
||||||
return [('id', 'in', [x.id for x in recs])] if recs else []
|
return [('id', 'in', [x.id for x in recs])] if recs else []
|
||||||
|
|
||||||
|
|
||||||
def action_reservation_checkout(self):
|
def action_reservation_checkout(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
record.state = 'done'
|
record.state = 'done'
|
||||||
@@ -1421,7 +1421,7 @@ class PmsReservation(models.Model):
|
|||||||
splitted_reservs.update({'state': 'done'})
|
splitted_reservs.update({'state': 'done'})
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def action_checks(self):
|
def action_checks(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
action = self.env.ref(
|
action = self.env.ref(
|
||||||
@@ -1437,7 +1437,7 @@ class PmsReservation(models.Model):
|
|||||||
RESERVATION SPLITTED -----------------------------------------------
|
RESERVATION SPLITTED -----------------------------------------------
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def split(self, nights):
|
def split(self, nights):
|
||||||
for record in self:
|
for record in self:
|
||||||
date_start_dt = fields.Date.from_string(record.checkin)
|
date_start_dt = fields.Date.from_string(record.checkin)
|
||||||
@@ -1490,7 +1490,7 @@ class PmsReservation(models.Model):
|
|||||||
})
|
})
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def unify(self):
|
def unify(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
if not self.splitted:
|
if not self.splitted:
|
||||||
@@ -1570,7 +1570,7 @@ class PmsReservation(models.Model):
|
|||||||
})
|
})
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def open_master(self):
|
def open_master(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
if not self.parent_reservation:
|
if not self.parent_reservation:
|
||||||
@@ -1586,15 +1586,15 @@ class PmsReservation(models.Model):
|
|||||||
MAILING PROCESS
|
MAILING PROCESS
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def send_reservation_mail(self):
|
def send_reservation_mail(self):
|
||||||
return self.folio_id.send_reservation_mail()
|
return self.folio_id.send_reservation_mail()
|
||||||
|
|
||||||
|
|
||||||
def send_exit_mail(self):
|
def send_exit_mail(self):
|
||||||
return self.folio_id.send_exit_mail()
|
return self.folio_id.send_exit_mail()
|
||||||
|
|
||||||
|
|
||||||
def send_cancel_mail(self):
|
def send_cancel_mail(self):
|
||||||
return self.folio_id.send_cancel_mail()
|
return self.folio_id.send_cancel_mail()
|
||||||
|
|
||||||
@@ -1602,7 +1602,7 @@ class PmsReservation(models.Model):
|
|||||||
INVOICING PROCESS
|
INVOICING PROCESS
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def _compute_tax_ids(self):
|
def _compute_tax_ids(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
# If company_id is set, always filter taxes by the company
|
# 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
|
lambda r: not record.company_id or
|
||||||
r.company_id == folio.company_id)
|
r.company_id == folio.company_id)
|
||||||
|
|
||||||
|
|
||||||
def set_call_center_user(self):
|
def set_call_center_user(self):
|
||||||
user = self.env['res.users'].browse(self.env.uid)
|
user = self.env['res.users'].browse(self.env.uid)
|
||||||
return user.has_group('pms.group_pms_call')
|
return user.has_group('pms.group_pms_call')
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
# Copyright 2017 Dario Lodeiros
|
# Copyright 2017 Dario Lodeiros
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
from odoo import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
from odoo.addons import decimal_precision as dp
|
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
|
|
||||||
|
|
||||||
class PmsReservationLine(models.Model):
|
class PmsReservationLine(models.Model):
|
||||||
_name = "pms.reservation.line"
|
_name = "pms.reservation.line"
|
||||||
|
_description = "Reservations by day"
|
||||||
_order = "date"
|
_order = "date"
|
||||||
|
|
||||||
# Default Methods ang Gets
|
# Default Methods ang Gets
|
||||||
|
|
||||||
def name_get(self):
|
def name_get(self):
|
||||||
result = []
|
result = []
|
||||||
for res in self:
|
for res in self:
|
||||||
@@ -44,13 +44,13 @@ class PmsReservationLine(models.Model):
|
|||||||
state = fields.Selection(related='reservation_id.state')
|
state = fields.Selection(related='reservation_id.state')
|
||||||
price = fields.Float(
|
price = fields.Float(
|
||||||
string='Price',
|
string='Price',
|
||||||
digits=dp.get_precision('Product Price'))
|
digits=('Product Price'))
|
||||||
cancel_discount = fields.Float(
|
cancel_discount = fields.Float(
|
||||||
string='Cancel Discount (%)',
|
string='Cancel Discount (%)',
|
||||||
digits=dp.get_precision('Discount'), default=0.0)
|
digits=('Discount'), default=0.0)
|
||||||
discount = fields.Float(
|
discount = fields.Float(
|
||||||
string='Discount (%)',
|
string='Discount (%)',
|
||||||
digits=dp.get_precision('Discount'), default=0.0)
|
digits=('Discount'), default=0.0)
|
||||||
|
|
||||||
# Constraints and onchanges
|
# Constraints and onchanges
|
||||||
@api.constrains('date')
|
@api.constrains('date')
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ class PmsRoomTypeRestriction(models.Model):
|
|||||||
""" The room type restriction is used as a daily restriction plan for room types
|
""" The room type restriction is used as a daily restriction plan for room types
|
||||||
and therefore is related only with one property. """
|
and therefore is related only with one property. """
|
||||||
_name = 'pms.room.type.restriction'
|
_name = 'pms.room.type.restriction'
|
||||||
|
_description = 'Reservation restriction plan'
|
||||||
|
|
||||||
# Default methods
|
# Default methods
|
||||||
@api.model
|
@api.model
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ from odoo.exceptions import ValidationError
|
|||||||
|
|
||||||
class PmsRoomTypeRestrictionItem(models.Model):
|
class PmsRoomTypeRestrictionItem(models.Model):
|
||||||
_name = 'pms.room.type.restriction.item'
|
_name = 'pms.room.type.restriction.item'
|
||||||
|
_description = 'Reservation restriction by day'
|
||||||
|
|
||||||
# Field Declarations
|
# Field Declarations
|
||||||
restriction_id = fields.Many2one('pms.room.type.restriction',
|
restriction_id = fields.Many2one('pms.room.type.restriction',
|
||||||
@@ -29,7 +30,7 @@ class PmsRoomTypeRestrictionItem(models.Model):
|
|||||||
day for the same room type!')]
|
day for the same room type!')]
|
||||||
|
|
||||||
# Constraints and onchanges
|
# Constraints and onchanges
|
||||||
|
|
||||||
@api.constrains('min_stay', 'min_stay_arrival', 'max_stay',
|
@api.constrains('min_stay', 'min_stay_arrival', 'max_stay',
|
||||||
'max_stay_arrival')
|
'max_stay_arrival')
|
||||||
def _check_min_stay(self):
|
def _check_min_stay(self):
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ from odoo.tools import (
|
|||||||
float_compare,
|
float_compare,
|
||||||
DEFAULT_SERVER_DATE_FORMAT)
|
DEFAULT_SERVER_DATE_FORMAT)
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from odoo.addons import decimal_precision as dp
|
|
||||||
import logging
|
import logging
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -17,7 +16,7 @@ class PmsService(models.Model):
|
|||||||
_description = 'Services and its charges'
|
_description = 'Services and its charges'
|
||||||
|
|
||||||
# Default methods
|
# Default methods
|
||||||
|
|
||||||
def name_get(self):
|
def name_get(self):
|
||||||
result = []
|
result = []
|
||||||
for rec in self:
|
for rec in self:
|
||||||
@@ -123,22 +122,22 @@ class PmsService(models.Model):
|
|||||||
price_unit = fields.Float(
|
price_unit = fields.Float(
|
||||||
'Unit Price',
|
'Unit Price',
|
||||||
required=True,
|
required=True,
|
||||||
digits=dp.get_precision('Product Price'), default=0.0)
|
digits=('Product Price'), default=0.0)
|
||||||
discount = fields.Float(
|
discount = fields.Float(
|
||||||
string='Discount (%)',
|
string='Discount (%)',
|
||||||
digits=dp.get_precision('Discount'), default=0.0)
|
digits=('Discount'), default=0.0)
|
||||||
qty_to_invoice = fields.Float(
|
qty_to_invoice = fields.Float(
|
||||||
compute='_get_to_invoice_qty',
|
compute='_get_to_invoice_qty',
|
||||||
string='To Invoice',
|
string='To Invoice',
|
||||||
store=True,
|
store=True,
|
||||||
readonly=True,
|
readonly=True,
|
||||||
digits=dp.get_precision('Product Unit of Measure'))
|
digits=('Product Unit of Measure'))
|
||||||
qty_invoiced = fields.Float(
|
qty_invoiced = fields.Float(
|
||||||
compute='_get_invoice_qty',
|
compute='_get_invoice_qty',
|
||||||
string='Invoiced',
|
string='Invoiced',
|
||||||
store=True,
|
store=True,
|
||||||
readonly=True,
|
readonly=True,
|
||||||
digits=dp.get_precision('Product Unit of Measure'))
|
digits=('Product Unit of Measure'))
|
||||||
price_subtotal = fields.Monetary(
|
price_subtotal = fields.Monetary(
|
||||||
string='Subtotal',
|
string='Subtotal',
|
||||||
readonly=True,
|
readonly=True,
|
||||||
@@ -337,7 +336,7 @@ class PmsService(models.Model):
|
|||||||
record.update(vals)
|
record.update(vals)
|
||||||
|
|
||||||
# Action methods
|
# Action methods
|
||||||
|
|
||||||
def open_service_ids(self):
|
def open_service_ids(self):
|
||||||
action = self.env.ref('pms.action_pms_services_form').read()[0]
|
action = self.env.ref('pms.action_pms_services_form').read()[0]
|
||||||
action['views'] = [
|
action['views'] = [
|
||||||
@@ -387,7 +386,7 @@ class PmsService(models.Model):
|
|||||||
record = super(PmsService, self).create(vals)
|
record = super(PmsService, self).create(vals)
|
||||||
return record
|
return record
|
||||||
|
|
||||||
|
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
# If you write product, We must check if its necesary create or delete
|
# If you write product, We must check if its necesary create or delete
|
||||||
# service lines
|
# service lines
|
||||||
@@ -439,7 +438,7 @@ class PmsService(models.Model):
|
|||||||
line[field], line)
|
line[field], line)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
def compute_lines_out_vals(self, vals):
|
def compute_lines_out_vals(self, vals):
|
||||||
"""
|
"""
|
||||||
Compute if It is necesary service days in write/create
|
Compute if It is necesary service days in write/create
|
||||||
@@ -453,7 +452,7 @@ class PmsService(models.Model):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def _compute_tax_ids(self):
|
def _compute_tax_ids(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
# If company_id is set, always filter taxes by the company
|
# If company_id is set, always filter taxes by the company
|
||||||
@@ -466,7 +465,7 @@ class PmsService(models.Model):
|
|||||||
lambda r: not record.company_id or
|
lambda r: not record.company_id or
|
||||||
r.company_id == origin.company_id)
|
r.company_id == origin.company_id)
|
||||||
|
|
||||||
|
|
||||||
def _get_display_price(self, product):
|
def _get_display_price(self, product):
|
||||||
folio = self.folio_id or self.env.context.get('default_folio_id')
|
folio = self.folio_id or self.env.context.get('default_folio_id')
|
||||||
reservation = self.reservation_id or self.env.context.get(
|
reservation = self.reservation_id or self.env.context.get(
|
||||||
@@ -499,7 +498,7 @@ class PmsService(models.Model):
|
|||||||
# negative discounts (= surcharge) are included in the display price
|
# negative discounts (= surcharge) are included in the display price
|
||||||
return max(base_price, final_price)
|
return max(base_price, final_price)
|
||||||
|
|
||||||
|
|
||||||
def _compute_price_unit(self):
|
def _compute_price_unit(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
folio = self.folio_id or self.env.context.get('default_folio_id')
|
folio = self.folio_id or self.env.context.get('default_folio_id')
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ from odoo.exceptions import ValidationError
|
|||||||
|
|
||||||
class PmsServiceLine(models.Model):
|
class PmsServiceLine(models.Model):
|
||||||
_name = "pms.service.line"
|
_name = "pms.service.line"
|
||||||
|
_description = "Service by day"
|
||||||
_order = "date"
|
_order = "date"
|
||||||
|
|
||||||
# Fields declaration
|
# Fields declaration
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ user_access_pms_board_service_line,user_access_pms_board_service_line,model_pms_
|
|||||||
user_access_account_partial_reconcile,user_access_account_partial_reconcile,account.model_account_partial_reconcile,pms.group_pms_user,1,1,1,1
|
user_access_account_partial_reconcile,user_access_account_partial_reconcile,account.model_account_partial_reconcile,pms.group_pms_user,1,1,1,1
|
||||||
user_access_pms_cancelation_rule,user_access_pms_cancelation_rule,model_pms_cancelation_rule,pms.group_pms_user,1,0,0,0
|
user_access_pms_cancelation_rule,user_access_pms_cancelation_rule,model_pms_cancelation_rule,pms.group_pms_user,1,0,0,0
|
||||||
user_access_account_full_reconcile,user_access_account_full_reconcile,account.model_account_full_reconcile,pms.group_pms_user,1,1,1,1
|
user_access_account_full_reconcile,user_access_account_full_reconcile,account.model_account_full_reconcile,pms.group_pms_user,1,1,1,1
|
||||||
|
call_access_pms_cancelation_rule,call_access_pms_cancelation_rule,model_pms_cancelation_rule,base.group_user,1,0,0,0
|
||||||
|
user_access_property,user_access_property,model_pms_property,pms.group_pms_user,1,0,0,0
|
||||||
manager_access_pms_floor,manager_access_pms_floor,model_pms_floor,pms.group_pms_manager,1,1,1,1
|
manager_access_pms_floor,manager_access_pms_floor,model_pms_floor,pms.group_pms_manager,1,1,1,1
|
||||||
manager_access_pms_amenity,manager_access_pms_amenity,model_pms_amenity,pms.group_pms_manager,1,1,1,1
|
manager_access_pms_amenity,manager_access_pms_amenity,model_pms_amenity,pms.group_pms_manager,1,1,1,1
|
||||||
manager_access_pms_amenity_type,manager_access_pms_amenity_type,model_pms_amenity_type,pms.group_pms_manager,1,1,1,1
|
manager_access_pms_amenity_type,manager_access_pms_amenity_type,model_pms_amenity_type,pms.group_pms_manager,1,1,1,1
|
||||||
@@ -42,6 +44,7 @@ manager_access_pms_room_type,manager_access_pms_room_type,model_pms_room_type,pm
|
|||||||
manager_access_pms_board_service_room_type,manager_access_pms_board_service_room_type,model_pms_board_service_room_type,pms.group_pms_manager,1,1,1,1
|
manager_access_pms_board_service_room_type,manager_access_pms_board_service_room_type,model_pms_board_service_room_type,pms.group_pms_manager,1,1,1,1
|
||||||
manager_access_pms_board_service_room_type_line,manager_access_pms_board_service_room_type_line,model_pms_board_service_room_type_line,pms.group_pms_manager,1,1,1,1
|
manager_access_pms_board_service_room_type_line,manager_access_pms_board_service_room_type_line,model_pms_board_service_room_type_line,pms.group_pms_manager,1,1,1,1
|
||||||
manager_access_pms_board_service_line,manager_access_pms_board_service_line,model_pms_board_service_line,pms.group_pms_manager,1,1,1,1
|
manager_access_pms_board_service_line,manager_access_pms_board_service_line,model_pms_board_service_line,pms.group_pms_manager,1,1,1,1
|
||||||
|
manager_access_property,manager_access_property,model_pms_property,pms.group_pms_manager,1,1,1,1
|
||||||
manager_access_pms_cancelation_rule,manager_access_pms_cancelation_rule,model_pms_cancelation_rule,base.group_user,1,1,1,1
|
manager_access_pms_cancelation_rule,manager_access_pms_cancelation_rule,model_pms_cancelation_rule,base.group_user,1,1,1,1
|
||||||
call_access_pms_floor,call_access_pms_floor,model_pms_floor,pms.group_pms_call,1,0,0,0
|
call_access_pms_floor,call_access_pms_floor,model_pms_floor,pms.group_pms_call,1,0,0,0
|
||||||
call_access_pms_amenity,call_access_pms_amenity,model_pms_amenity,pms.group_pms_call,1,0,0,0
|
call_access_pms_amenity,call_access_pms_amenity,model_pms_amenity,pms.group_pms_call,1,0,0,0
|
||||||
@@ -63,4 +66,4 @@ call_access_pms_room_type,call_access_pms_room_type,model_pms_room_type,pms.grou
|
|||||||
call_access_pms_board_service_room_type,call_access_pms_board_service_room_type,model_pms_board_service_room_type,pms.group_pms_call,1,0,0,0
|
call_access_pms_board_service_room_type,call_access_pms_board_service_room_type,model_pms_board_service_room_type,pms.group_pms_call,1,0,0,0
|
||||||
call_access_pms_board_service_room_type_line,call_access_pms_board_service_room_type_line,model_pms_board_service_room_type_line,pms.group_pms_call,1,0,0,0
|
call_access_pms_board_service_room_type_line,call_access_pms_board_service_room_type_line,model_pms_board_service_room_type_line,pms.group_pms_call,1,0,0,0
|
||||||
call_access_pms_board_service_line,call_access_pms_board_service_line,model_pms_board_service_line,pms.group_pms_call,1,0,0,0
|
call_access_pms_board_service_line,call_access_pms_board_service_line,model_pms_board_service_line,pms.group_pms_call,1,0,0,0
|
||||||
call_access_pms_cancelation_rule,call_access_pms_cancelation_rule,model_pms_cancelation_rule,base.group_user,1,0,0,0
|
call_access_property,call_access_property,model_pms_property,pms.group_pms_call,1,0,0,0
|
||||||
|
|||||||
|
@@ -30,7 +30,7 @@
|
|||||||
attrs="{'invisible': [('state','=','draft')]}"/>
|
attrs="{'invisible': [('state','=','draft')]}"/>
|
||||||
<button string="Delete" name="delete" type="object" class="oe_read_only btn-primary"
|
<button string="Delete" name="delete" type="object" class="oe_read_only btn-primary"
|
||||||
attrs="{'invisible': [('state','=','draft')]}"/>
|
attrs="{'invisible': [('state','=','draft')]}"/>
|
||||||
<button string="Cancel" class="oe_read_only btn-default" special="cancel"/>
|
<button string="Cancel" name="cancel" class="oe_read_only btn-default" special="cancel"/>
|
||||||
<field name="state" widget="statusbar" statusbar_visible="draft,posted,reconciled,cancelled"/>
|
<field name="state" widget="statusbar" statusbar_visible="draft,posted,reconciled,cancelled"/>
|
||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
@@ -55,26 +55,45 @@
|
|||||||
</div>
|
</div>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="payment_type" invisible="1"/>
|
<field name="company_id" invisible="1" />
|
||||||
<field name="save_amount" invisible="1"/>
|
<field name="payment_type" invisible="1" />
|
||||||
<field name="save_date" invisible="1"/>
|
<field name="save_amount" invisible="1" />
|
||||||
<field name="save_journal_id" invisible="1"/>
|
<field name="save_date" invisible="1" />
|
||||||
|
<field name="save_journal_id" invisible="1" />
|
||||||
<field name="partner_type" widget="selection" invisible="1"/>
|
<field name="partner_type" widget="selection" invisible="1"/>
|
||||||
<field name="partner_id" attrs="{'required': [('state', '=', 'draft'), ('payment_type', 'in', ('inbound', 'outbound'))], 'invisible': [('payment_type', 'not in', ('inbound', 'outbound'))]}" context="{'default_is_company': True, 'default_supplier': payment_type == 'outbound', 'default_customer': payment_type == 'inbound'}"/>
|
<field name="partner_id" attrs="{
|
||||||
|
'required': [('state', '=', 'draft'), ('payment_type', 'in', ('inbound', 'outbound'))],
|
||||||
|
'invisible': [('payment_type', 'not in', ('inbound', 'outbound'))]
|
||||||
|
}"
|
||||||
|
context="{
|
||||||
|
'default_is_company': True,
|
||||||
|
'default_supplier': payment_type == 'outbound',
|
||||||
|
'default_customer': payment_type == 'inbound'
|
||||||
|
}"/>
|
||||||
<label for="amount"/>
|
<label for="amount"/>
|
||||||
<div name="amount_div" class="o_row">
|
<div name="amount_div" class="o_row">
|
||||||
<field name="amount" />
|
<field name="amount" />
|
||||||
<field name="currency_id" options="{'no_create': True, 'no_open': True}" groups="base.group_multi_currency" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
|
<field name="currency_id"
|
||||||
|
options="{'no_create': True, 'no_open': True}"
|
||||||
|
groups="base.group_multi_currency"
|
||||||
|
attrs="{'readonly': [('state', '!=', 'draft')]}"/>
|
||||||
</div>
|
</div>
|
||||||
<field name="journal_id" widget="selection" />
|
<field name="journal_id" widget="selection" />
|
||||||
<field name="destination_journal_id" widget="selection" attrs="{'required': [('payment_type', '=', 'transfer')], 'invisible': [('payment_type', '!=', 'transfer')], 'readonly': [('state', '!=', 'draft')]}"/>
|
<field name="destination_journal_id"
|
||||||
|
widget="selection"
|
||||||
|
attrs="{
|
||||||
|
'required': [('payment_type', '=', 'transfer')],
|
||||||
|
'invisible': [('payment_type', '!=', 'transfer')],
|
||||||
|
'readonly': [('state', '!=', 'draft')]}"/>
|
||||||
<field name="hide_payment_method" invisible="1"/>
|
<field name="hide_payment_method" invisible="1"/>
|
||||||
<field name="payment_method_id" string=" " widget="radio" attrs="{'invisible': [('hide_payment_method', '=', True)]}"/>
|
<field name="payment_method_id" string=" " widget="radio"
|
||||||
|
attrs="{'invisible': [('hide_payment_method', '=', True)]}"/>
|
||||||
<field name="payment_method_code" invisible="1"/>
|
<field name="payment_method_code" invisible="1"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="payment_date" />
|
<field name="payment_date" />
|
||||||
<field name="communication" attrs="{'invisible': [('state', '!=', 'draft'), ('communication', '=', False)]}"/>
|
<field name="communication"
|
||||||
|
attrs="{'invisible': [('state', '!=', 'draft'), ('communication', '=', False)]}"/>
|
||||||
<field name="folio_id" readonly="1" force_save="1"/>
|
<field name="folio_id" readonly="1" force_save="1"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<xpath expr="//field[@name='user_id']" position="after">
|
<xpath expr="//field[@name='user_id']" position="after">
|
||||||
|
<field name="company_type" invisible="1" />
|
||||||
<field name="is_tour_operator" attrs="{'invisible': [('company_type','!=','company')]}"/>
|
<field name="is_tour_operator" attrs="{'invisible': [('company_type','!=','company')]}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<form string="Room Amenities">
|
<form string="Room Amenities">
|
||||||
<sheet>
|
<sheet>
|
||||||
<h1>
|
<h1>
|
||||||
<label string="Amenity" />
|
<label for="name" string="Amenity" />
|
||||||
<field name="name" select="1" />
|
<field name="name" select="1" />
|
||||||
</h1>
|
</h1>
|
||||||
<group>
|
<group>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
</group>
|
</group>
|
||||||
<notebook>
|
<notebook>
|
||||||
<page string="Information">
|
<page string="Information">
|
||||||
<group colspan="4" col="4">
|
<group colspan="4" col="4">
|
||||||
<field name="pms_property_ids" widget="many2many_tags"
|
<field name="pms_property_ids" widget="many2many_tags"
|
||||||
options="{'no_create': True,'no_open': True}"/>
|
options="{'no_create': True,'no_open': True}"/>
|
||||||
<field name="room_amenity_type_id" select="2" string="Amenity Type" />
|
<field name="room_amenity_type_id" select="2" string="Amenity Type" />
|
||||||
|
|||||||
@@ -60,13 +60,15 @@
|
|||||||
<!-- actions -->
|
<!-- actions -->
|
||||||
|
|
||||||
<record id="pms_property_action" model="ir.actions.act_window">
|
<record id="pms_property_action" model="ir.actions.act_window">
|
||||||
<field name="name">pmss</field>
|
<field name="name">Properties</field>
|
||||||
<field name="res_model">pms.property</field>
|
<field name="res_model">pms.property</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- menus -->
|
<!-- menus -->
|
||||||
|
|
||||||
<menuitem action="pms_property_action" id="pms_property_menu" parent="base.menu_users" sequence="10"/>
|
<menuitem action="pms_property_action" id="pms_property_menu"
|
||||||
|
parent="base.menu_users" sequence="10"
|
||||||
|
name = "Properties"/>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
attrs="{'invisible':[('splitted', '=', False)]}"
|
attrs="{'invisible':[('splitted', '=', False)]}"
|
||||||
/>
|
/>
|
||||||
<button name="open_master" string="Open Master" type="object" class="oe_highlight" icon="fa-file" attrs="{'invisible':['|',['parent_reservation', '=', False]]}" />
|
<button name="open_master" string="Open Master" type="object" class="oe_highlight" icon="fa-file" attrs="{'invisible':['|',['parent_reservation', '=', False]]}" />
|
||||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,booking,done" />
|
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,booking,done"/>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<sheet>
|
<sheet>
|
||||||
@@ -74,12 +74,14 @@
|
|||||||
<bold><button class="alert-link" type="object" name="open_folio" string="Folio Form"/></bold>
|
<bold><button class="alert-link" type="object" name="open_folio" string="Folio Form"/></bold>
|
||||||
</div>
|
</div>
|
||||||
<field name="shared_folio" invisible="1"/>
|
<field name="shared_folio" invisible="1"/>
|
||||||
<div class="oe_button_box" attrs="{'invisible': [('folio_id','=',False)]}">
|
<div class="oe_button_box" name="button_box" attrs="{'invisible': [('folio_id','=',False)]}">
|
||||||
<button type="object" class="oe_stat_button"
|
<button type="object" class="oe_stat_button"
|
||||||
icon="fa-file"
|
icon="fa-file"
|
||||||
name="open_folio">
|
name="open_folio">
|
||||||
<div class="o_form_field o_stat_info">
|
<div class="o_field_widget o_stat_info">
|
||||||
<span class="o_stat_text"><field name="folio_id" readonly="1" nolabel="1"/></span>
|
<span class="o_stat_text">
|
||||||
|
<field name="folio_id" readonly="1" nolabel="1"/>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
<button type="action" class="oe_stat_button"
|
<button type="action" class="oe_stat_button"
|
||||||
@@ -87,7 +89,7 @@
|
|||||||
attrs="{'invisible': ['|', ('partner_id','=',False), ('reservation_type','in',('out'))]}"
|
attrs="{'invisible': ['|', ('partner_id','=',False), ('reservation_type','in',('out'))]}"
|
||||||
name="%(open_pms_reservation_form_tree_all)d"
|
name="%(open_pms_reservation_form_tree_all)d"
|
||||||
context="{'search_default_partner_id': partner_id}">
|
context="{'search_default_partner_id': partner_id}">
|
||||||
<div class="o_form_field o_stat_info">
|
<div class="o_field_widget o_stat_info">
|
||||||
<span class="o_stat_text">Books</span>
|
<span class="o_stat_text">Books</span>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
@@ -96,7 +98,7 @@
|
|||||||
icon="fa-money"
|
icon="fa-money"
|
||||||
name="action_pay_folio"
|
name="action_pay_folio"
|
||||||
attrs="{'invisible': ['|',('folio_pending_amount','<=',0)]}">
|
attrs="{'invisible': ['|',('folio_pending_amount','<=',0)]}">
|
||||||
<div class="o_form_field o_stat_info">
|
<div class="o_field_widget o_stat_info">
|
||||||
<span class="o_stat_value">
|
<span class="o_stat_value">
|
||||||
<field name="folio_pending_amount" nolabel="1"
|
<field name="folio_pending_amount" nolabel="1"
|
||||||
widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||||
@@ -107,7 +109,7 @@
|
|||||||
<button type="object" class="oe_stat_button" id="invoice_button"
|
<button type="object" class="oe_stat_button" id="invoice_button"
|
||||||
icon="fa-pencil-square-o" name="open_invoices_reservation"
|
icon="fa-pencil-square-o" name="open_invoices_reservation"
|
||||||
attrs="{'invisible': [('invoice_count','<=',0)]}">
|
attrs="{'invisible': [('invoice_count','<=',0)]}">
|
||||||
<div class="o_form_field o_stat_info">
|
<div class="o_field_widget o_stat_info">
|
||||||
<span class="o_stat_value">
|
<span class="o_stat_value">
|
||||||
<field name="invoice_count"/>
|
<field name="invoice_count"/>
|
||||||
</span>
|
</span>
|
||||||
@@ -118,7 +120,7 @@
|
|||||||
icon="fa-chain-broken"
|
icon="fa-chain-broken"
|
||||||
name="open_master"
|
name="open_master"
|
||||||
attrs="{'invisible':[('splitted','=',False)]}">
|
attrs="{'invisible':[('splitted','=',False)]}">
|
||||||
<div class="o_form_field o_stat_info">
|
<div class="o_field_widget o_stat_info">
|
||||||
<span><field name="parent_reservation"
|
<span><field name="parent_reservation"
|
||||||
nolabel="1" readonly="1"/></span>
|
nolabel="1" readonly="1"/></span>
|
||||||
<span class="o_stat_text">Splitted!</span>
|
<span class="o_stat_text">Splitted!</span>
|
||||||
@@ -160,11 +162,13 @@
|
|||||||
attrs="{'invisible': [('reservation_type','not in',('out'))]}"/>
|
attrs="{'invisible': [('reservation_type','not in',('out'))]}"/>
|
||||||
</h1>
|
</h1>
|
||||||
<h3>
|
<h3>
|
||||||
From <span class="fa fa-sign-in" style="margin: 5px;"/>
|
<group>
|
||||||
<field name="checkin" style="margin-right: 10px;"/>
|
<div class="o_row">
|
||||||
to
|
<field name="checkin" widget="daterange" nolabel="1" class="oe_inline" options="{'related_end_date': 'checkout'}"/>
|
||||||
<span class="fa fa-sign-out" style="margin-right: 5px;"/>
|
<i class="fa fa-long-arrow-right mx-2" aria-label="Arrow icon" title="Arrow"/>
|
||||||
<field name="checkout" />
|
<field name="checkout" widget="daterange" nolabel="1" class="oe_inline" options="{'related_start_date': 'checkin'}"/>
|
||||||
|
</div>
|
||||||
|
</group>
|
||||||
</h3>
|
</h3>
|
||||||
<field name="out_service_description" placeholder="Out service description"
|
<field name="out_service_description" placeholder="Out service description"
|
||||||
attrs="{'invisible':[('reservation_type','not in',('out'))]}"/>
|
attrs="{'invisible':[('reservation_type','not in',('out'))]}"/>
|
||||||
|
|||||||
@@ -58,13 +58,16 @@
|
|||||||
<search string="Services By Day">
|
<search string="Services By Day">
|
||||||
<field name="service_id" />
|
<field name="service_id" />
|
||||||
<filter string="Today"
|
<filter string="Today"
|
||||||
domain="[('date', '=', context_today().strftime('%Y-%m-%d'))]"
|
name="today"
|
||||||
help="Current Booking" />
|
domain="[('date', '=', context_today().strftime('%Y-%m-%d'))]"
|
||||||
|
help="Current Booking" />
|
||||||
<filter string="Tomorrow"
|
<filter string="Tomorrow"
|
||||||
domain="[('date', '=', (context_today()+datetime.timedelta(days=1)).strftime('%Y-%m-%d'))]"
|
name="tomorrow"
|
||||||
/>
|
domain="[('date', '=', (context_today()+datetime.timedelta(days=1)).strftime('%Y-%m-%d'))]"
|
||||||
|
/>
|
||||||
<filter string="Next 7 days"
|
<filter string="Next 7 days"
|
||||||
domain="[('date', '>', context_today().strftime('%Y-%m-%d')),
|
name="next_7_days"
|
||||||
|
domain="[('date', '>', context_today().strftime('%Y-%m-%d')),
|
||||||
('date', '<', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d'))]"
|
('date', '<', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d'))]"
|
||||||
/>
|
/>
|
||||||
<group expand="0" string="Group By">
|
<group expand="0" string="Group By">
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
import time
|
import time
|
||||||
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
|
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
|
||||||
from odoo import api, fields, models, _
|
from odoo import api, fields, models, _
|
||||||
import odoo.addons.decimal_precision as dp
|
|
||||||
from odoo.exceptions import UserError, ValidationError
|
from odoo.exceptions import UserError, ValidationError
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
@@ -85,7 +84,7 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
|||||||
product_id = fields.Many2one('product.product', string="Product",
|
product_id = fields.Many2one('product.product', string="Product",
|
||||||
domain=[('type', '=', 'service')], default=_default_product_id)
|
domain=[('type', '=', 'service')], default=_default_product_id)
|
||||||
amount = fields.Float('Down Payment Amount',
|
amount = fields.Float('Down Payment Amount',
|
||||||
digits=dp.get_precision('Account'),
|
digits=('Account'),
|
||||||
help="The amount to be invoiced in advance, taxes excluded.")
|
help="The amount to be invoiced in advance, taxes excluded.")
|
||||||
deposit_account_id = fields.Many2one("account.account", string="Income Account",
|
deposit_account_id = fields.Many2one("account.account", string="Income Account",
|
||||||
domain=[('deprecated', '=', False)],
|
domain=[('deprecated', '=', False)],
|
||||||
@@ -106,7 +105,7 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
|||||||
return {'value': {'amount': 0}}
|
return {'value': {'amount': 0}}
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
||||||
def _create_invoice(self, folio, service, amount):
|
def _create_invoice(self, folio, service, amount):
|
||||||
inv_obj = self.env['account.invoice']
|
inv_obj = self.env['account.invoice']
|
||||||
ir_property_obj = self.env['ir.property']
|
ir_property_obj = self.env['ir.property']
|
||||||
@@ -142,7 +141,7 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
|||||||
|
|
||||||
invoice = inv_obj.create({
|
invoice = inv_obj.create({
|
||||||
'name': folio.client_order_ref or folio.name,
|
'name': folio.client_order_ref or folio.name,
|
||||||
'origin': folio.name,
|
'invoice_origin': folio.name,
|
||||||
'type': 'out_invoice',
|
'type': 'out_invoice',
|
||||||
'reference': False,
|
'reference': False,
|
||||||
'folio_ids': [(6, 0, [folio.id])], #REVIEW: Folio_ids is a computed field, Why need this value?
|
'folio_ids': [(6, 0, [folio.id])], #REVIEW: Folio_ids is a computed field, Why need this value?
|
||||||
@@ -150,7 +149,7 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
|||||||
'partner_id': folio.partner_invoice_id.id,
|
'partner_id': folio.partner_invoice_id.id,
|
||||||
'invoice_line_ids': [(0, 0, {
|
'invoice_line_ids': [(0, 0, {
|
||||||
'name': name,
|
'name': name,
|
||||||
'origin': folio.name,
|
'invoice_origin': folio.name,
|
||||||
'account_id': account_id,
|
'account_id': account_id,
|
||||||
'price_unit': amount,
|
'price_unit': amount,
|
||||||
'quantity': 1.0,
|
'quantity': 1.0,
|
||||||
@@ -172,7 +171,7 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
|||||||
invoice.compute_taxes()
|
invoice.compute_taxes()
|
||||||
invoice.message_post_with_view(
|
invoice.message_post_with_view(
|
||||||
'mail.message_origin_link',
|
'mail.message_origin_link',
|
||||||
values={'self': invoice, 'origin': folio},
|
values={'self': invoice, 'invoice_origin': folio},
|
||||||
subtype_id=self.env.ref('mail.mt_note').id)
|
subtype_id=self.env.ref('mail.mt_note').id)
|
||||||
return invoice
|
return invoice
|
||||||
|
|
||||||
@@ -201,7 +200,7 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
|||||||
invoice.assign_outstanding_credit(line.id)
|
invoice.assign_outstanding_credit(line.id)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def create_invoices(self):
|
def create_invoices(self):
|
||||||
inv_obj = self.env['account.invoice']
|
inv_obj = self.env['account.invoice']
|
||||||
precision = self.env['decimal.precision'].precision_get('Product Unit of Measure')
|
precision = self.env['decimal.precision'].precision_get('Product Unit of Measure')
|
||||||
@@ -270,7 +269,7 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
|||||||
invoice.compute_taxes()
|
invoice.compute_taxes()
|
||||||
self._validate_invoices(invoice)
|
self._validate_invoices(invoice)
|
||||||
invoice.message_post_with_view('mail.message_origin_link',
|
invoice.message_post_with_view('mail.message_origin_link',
|
||||||
values={'self': invoice, 'origin': folios},
|
values={'self': invoice, 'invoice_origin': folios},
|
||||||
subtype_id=self.env.ref('mail.mt_note').id)
|
subtype_id=self.env.ref('mail.mt_note').id)
|
||||||
if self._context.get('open_invoices', False):
|
if self._context.get('open_invoices', False):
|
||||||
return folios.open_invoices_folio()
|
return folios.open_invoices_folio()
|
||||||
@@ -394,7 +393,7 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
|||||||
# raise UserError(_('All Folios must hace the same pricelist'))
|
# raise UserError(_('All Folios must hace the same pricelist'))
|
||||||
invoice_vals = {
|
invoice_vals = {
|
||||||
'name': self.folio_ids[0].client_order_ref or '',
|
'name': self.folio_ids[0].client_order_ref or '',
|
||||||
'origin': origin,
|
'invoice_origin': origin,
|
||||||
'type': 'out_invoice',
|
'type': 'out_invoice',
|
||||||
'account_id': self.partner_invoice_id.property_account_receivable_id.id,
|
'account_id': self.partner_invoice_id.property_account_receivable_id.id,
|
||||||
'partner_id': self.partner_invoice_id.id,
|
'partner_id': self.partner_invoice_id.id,
|
||||||
@@ -427,7 +426,7 @@ class LineAdvancePaymentInv(models.TransientModel):
|
|||||||
price_room = fields.Float(compute='_compute_price_room')
|
price_room = fields.Float(compute='_compute_price_room')
|
||||||
discount = fields.Float(
|
discount = fields.Float(
|
||||||
string='Discount (%)',
|
string='Discount (%)',
|
||||||
digits=dp.get_precision('Discount'), default=0.0)
|
digits=('Discount'), default=0.0)
|
||||||
to_invoice = fields.Boolean('To Invoice')
|
to_invoice = fields.Boolean('To Invoice')
|
||||||
description = fields.Text('Description')
|
description = fields.Text('Description')
|
||||||
description_dates = fields.Text('Range')
|
description_dates = fields.Text('Range')
|
||||||
@@ -474,7 +473,7 @@ class LineAdvancePaymentInv(models.TransientModel):
|
|||||||
((fields.Date.from_string(record.reservation_line_ids[-1].date)) + \
|
((fields.Date.from_string(record.reservation_line_ids[-1].date)) + \
|
||||||
timedelta(days=1)).strftime(DEFAULT_SERVER_DATE_FORMAT)
|
timedelta(days=1)).strftime(DEFAULT_SERVER_DATE_FORMAT)
|
||||||
|
|
||||||
|
|
||||||
def invoice_line_create(self, invoice_id, qty):
|
def invoice_line_create(self, invoice_id, qty):
|
||||||
""" Create an invoice line.
|
""" Create an invoice line.
|
||||||
:param invoice_id: integer
|
:param invoice_id: integer
|
||||||
@@ -496,7 +495,7 @@ class LineAdvancePaymentInv(models.TransientModel):
|
|||||||
account = fpos.map_account(account)
|
account = fpos.map_account(account)
|
||||||
vals = {
|
vals = {
|
||||||
'sequence': origin.sequence,
|
'sequence': origin.sequence,
|
||||||
'origin': origin.name,
|
'invoice_origin': origin.name,
|
||||||
'account_id': account.id,
|
'account_id': account.id,
|
||||||
'price_unit': self.price_unit,
|
'price_unit': self.price_unit,
|
||||||
'quantity': self.qty,
|
'quantity': self.qty,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<div attrs="{'invisible': [('advance_payment_method', 'not in', ('fixed','percentage'))]}">
|
<div attrs="{'invisible': [('advance_payment_method', 'not in', ('fixed','percentage'))]}">
|
||||||
<field name="amount"
|
<field name="amount"
|
||||||
attrs="{'required': [('advance_payment_method', 'in', ('fixed','percentage'))]}" class="oe_inline" widget="monetary"/>
|
attrs="{'required': [('advance_payment_method', 'in', ('fixed','percentage'))]}" class="oe_inline" widget="monetary"/>
|
||||||
<label string="%%"
|
<label for="" string="%%"
|
||||||
attrs="{'invisible': [('advance_payment_method', '!=', 'percentage')]}" class="oe_inline"/>
|
attrs="{'invisible': [('advance_payment_method', '!=', 'percentage')]}" class="oe_inline"/>
|
||||||
</div>
|
</div>
|
||||||
<field name="deposit_account_id" class="oe_inline"
|
<field name="deposit_account_id" class="oe_inline"
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
<field name="res_model">folio.advance.payment.inv</field>
|
<field name="res_model">folio.advance.payment.inv</field>
|
||||||
<field name="view_mode">form</field>
|
<field name="view_mode">form</field>
|
||||||
<field name="target">new</field>
|
<field name="target">new</field>
|
||||||
<field name="groups_id" eval="[(4,ref('sales_team.group_sale_salesman'))]"/>
|
<field name="groups_id" eval="[(4,ref('pms.group_pms_user'))]"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
|
|||||||
|
|
||||||
class MassiveChangesWizard(models.TransientModel):
|
class MassiveChangesWizard(models.TransientModel):
|
||||||
_name = 'pms.wizard.massive.changes'
|
_name = 'pms.wizard.massive.changes'
|
||||||
|
_description = 'Massive Changes'
|
||||||
|
|
||||||
# Default methods
|
# Default methods
|
||||||
@api.model
|
@api.model
|
||||||
@@ -91,7 +92,7 @@ class MassiveChangesWizard(models.TransientModel):
|
|||||||
self.date_end = self.date_start
|
self.date_end = self.date_start
|
||||||
|
|
||||||
# Action methods
|
# Action methods
|
||||||
|
|
||||||
def _get_restrictions_values(self, record):
|
def _get_restrictions_values(self, record):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
vals = {}
|
vals = {}
|
||||||
@@ -208,7 +209,7 @@ class MassiveChangesWizard(models.TransientModel):
|
|||||||
elif record.section == 'prices':
|
elif record.section == 'prices':
|
||||||
self._save_prices(ndate, room_types, record)
|
self._save_prices(ndate, room_types, record)
|
||||||
|
|
||||||
|
|
||||||
def _do_massive_change(self):
|
def _do_massive_change(self):
|
||||||
pms_room_type_obj = self.env['pms.room.type']
|
pms_room_type_obj = self.env['pms.room.type']
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -230,20 +231,20 @@ class MassiveChangesWizard(models.TransientModel):
|
|||||||
self._save(ndate, room_types, record)
|
self._save(ndate, room_types, record)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def massive_change(self):
|
def massive_change(self):
|
||||||
self._do_massive_change()
|
self._do_massive_change()
|
||||||
return {
|
return {
|
||||||
"type": "ir.actions.do_nothing",
|
"type": "ir.actions.do_nothing",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def massive_change_close(self):
|
def massive_change_close(self):
|
||||||
self._do_massive_change()
|
self._do_massive_change()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# TODO: method deprecated and not used anywhere
|
# TODO: method deprecated and not used anywhere
|
||||||
|
|
||||||
def is_valid_date(self, chkdate):
|
def is_valid_date(self, chkdate):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
wday = chkdate.timetuple()[6]
|
wday = chkdate.timetuple()[6]
|
||||||
|
|||||||
@@ -5,13 +5,14 @@ from openerp import models, fields, api
|
|||||||
|
|
||||||
class MassivePriceChangeWizard(models.TransientModel):
|
class MassivePriceChangeWizard(models.TransientModel):
|
||||||
_name = 'pms.wizard.massive.price.reservation.days'
|
_name = 'pms.wizard.massive.price.reservation.days'
|
||||||
|
_description = 'Massive Price Changes'
|
||||||
|
|
||||||
new_price = fields.Float('New Price', default=1, min=1)
|
new_price = fields.Float('New Price', default=1, min=1)
|
||||||
change_price = fields.Boolean('Change Prices', default=False)
|
change_price = fields.Boolean('Change Prices', default=False)
|
||||||
new_discount = fields.Float('New Discount', default=0, min=1)
|
new_discount = fields.Float('New Discount', default=0, min=1)
|
||||||
change_discount = fields.Boolean('Change Discounts', default=False)
|
change_discount = fields.Boolean('Change Discounts', default=False)
|
||||||
|
|
||||||
|
|
||||||
def massive_price_change_days(self):
|
def massive_price_change_days(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
pms_reservation_obj = self.env['pms.reservation']
|
pms_reservation_obj = self.env['pms.reservation']
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ from odoo.tools import (
|
|||||||
|
|
||||||
class ServiceOnDay(models.TransientModel):
|
class ServiceOnDay(models.TransientModel):
|
||||||
_name = 'service.on.day'
|
_name = 'service.on.day'
|
||||||
|
_description = 'Set service for today'
|
||||||
|
|
||||||
def _get_default_date(self):
|
def _get_default_date(self):
|
||||||
tz_property = self.env.user.pms_property_id.tz
|
tz_property = self.env.user.pms_property_id.tz
|
||||||
@@ -18,7 +19,7 @@ class ServiceOnDay(models.TransientModel):
|
|||||||
product_qty = fields.Integer('Quantity', default=1)
|
product_qty = fields.Integer('Quantity', default=1)
|
||||||
date = fields.Date('Date', default=_get_default_date)
|
date = fields.Date('Date', default=_get_default_date)
|
||||||
|
|
||||||
|
|
||||||
def set_service(self):
|
def set_service(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
pms_reservation_obj = self.env['pms.reservation']
|
pms_reservation_obj = self.env['pms.reservation']
|
||||||
|
|||||||
@@ -10,10 +10,11 @@ from openerp.tools import (
|
|||||||
|
|
||||||
class SplitReservationWizard(models.TransientModel):
|
class SplitReservationWizard(models.TransientModel):
|
||||||
_name = 'pms.wizard.split.reservation'
|
_name = 'pms.wizard.split.reservation'
|
||||||
|
_description = 'Split Reservation'
|
||||||
|
|
||||||
nights = fields.Integer('Nights', default=1, min=1)
|
nights = fields.Integer('Nights', default=1, min=1)
|
||||||
|
|
||||||
|
|
||||||
def split_reservation(self):
|
def split_reservation(self):
|
||||||
reservation_id = self.env['pms.reservation'].browse(
|
reservation_id = self.env['pms.reservation'].browse(
|
||||||
self.env.context.get('active_id'))
|
self.env.context.get('active_id'))
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ from odoo.tools import (
|
|||||||
DEFAULT_SERVER_DATE_FORMAT,
|
DEFAULT_SERVER_DATE_FORMAT,
|
||||||
DEFAULT_SERVER_DATETIME_FORMAT)
|
DEFAULT_SERVER_DATETIME_FORMAT)
|
||||||
from odoo import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
import odoo.addons.decimal_precision as dp
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class FolioWizard(models.TransientModel):
|
class FolioWizard(models.TransientModel):
|
||||||
_name = 'pms.folio.wizard'
|
_name = 'pms.folio.wizard'
|
||||||
|
_description = 'Wizard for reservation groups'
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _get_default_center_user(self):
|
def _get_default_center_user(self):
|
||||||
@@ -159,7 +159,7 @@ class FolioWizard(models.TransientModel):
|
|||||||
}))
|
}))
|
||||||
self.reservation_wizard_ids = cmds
|
self.reservation_wizard_ids = cmds
|
||||||
|
|
||||||
|
|
||||||
@api.onchange('checkin', 'checkout')
|
@api.onchange('checkin', 'checkout')
|
||||||
def onchange_checks(self):
|
def onchange_checks(self):
|
||||||
'''
|
'''
|
||||||
@@ -213,7 +213,7 @@ class FolioWizard(models.TransientModel):
|
|||||||
total += line.price
|
total += line.price
|
||||||
self.total = total
|
self.total = total
|
||||||
|
|
||||||
|
|
||||||
def create_folio(self):
|
def create_folio(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
if not self.partner_id:
|
if not self.partner_id:
|
||||||
@@ -275,8 +275,9 @@ class FolioWizard(models.TransientModel):
|
|||||||
|
|
||||||
class PmsRoomTypeWizards(models.TransientModel):
|
class PmsRoomTypeWizards(models.TransientModel):
|
||||||
_name = 'pms.room.type.wizard'
|
_name = 'pms.room.type.wizard'
|
||||||
|
_description = 'Virtual Room Type to Reserve Groups'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_default_checkin(self):
|
def _get_default_checkin(self):
|
||||||
return self.folio_wizard_id.checkin
|
return self.folio_wizard_id.checkin
|
||||||
|
|
||||||
@@ -303,7 +304,7 @@ class PmsRoomTypeWizards(models.TransientModel):
|
|||||||
board_service_room_id = fields.Many2one('pms.board.service.room.type',
|
board_service_room_id = fields.Many2one('pms.board.service.room.type',
|
||||||
string="Board Service")
|
string="Board Service")
|
||||||
|
|
||||||
|
|
||||||
@api.onchange('rooms_num')
|
@api.onchange('rooms_num')
|
||||||
def domain_board_service(self):
|
def domain_board_service(self):
|
||||||
for line in self:
|
for line in self:
|
||||||
@@ -317,7 +318,7 @@ class PmsRoomTypeWizards(models.TransientModel):
|
|||||||
domain_boardservice = [('id', 'in', board_service_room_ids)]
|
domain_boardservice = [('id', 'in', board_service_room_ids)]
|
||||||
return {'domain': {'board_service_room_id': domain_boardservice}}
|
return {'domain': {'board_service_room_id': domain_boardservice}}
|
||||||
|
|
||||||
|
|
||||||
def _can_confirm(self):
|
def _can_confirm(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
date_start = fields.Date.from_string(record.checkin)
|
date_start = fields.Date.from_string(record.checkin)
|
||||||
@@ -434,6 +435,7 @@ class PmsRoomTypeWizards(models.TransientModel):
|
|||||||
|
|
||||||
class ReservationWizard(models.TransientModel):
|
class ReservationWizard(models.TransientModel):
|
||||||
_name = 'pms.reservation.wizard'
|
_name = 'pms.reservation.wizard'
|
||||||
|
_description = 'Virtual Reservation to Groups'
|
||||||
_rec_name = 'room_id'
|
_rec_name = 'room_id'
|
||||||
|
|
||||||
room_id = fields.Many2one('pms.room',
|
room_id = fields.Many2one('pms.room',
|
||||||
@@ -458,14 +460,14 @@ class ReservationWizard(models.TransientModel):
|
|||||||
board_service_room_id = fields.Many2one('pms.board.service.room.type',
|
board_service_room_id = fields.Many2one('pms.board.service.room.type',
|
||||||
string="Board Service")
|
string="Board Service")
|
||||||
|
|
||||||
|
|
||||||
def _compute_assign(self):
|
def _compute_assign(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
user = self.env['res.users'].browse(self.env.uid)
|
user = self.env['res.users'].browse(self.env.uid)
|
||||||
if user.has_group('pms.group_pms_call'):
|
if user.has_group('pms.group_pms_call'):
|
||||||
rec.to_assign = True
|
rec.to_assign = True
|
||||||
|
|
||||||
|
|
||||||
@api.onchange('room_id')
|
@api.onchange('room_id')
|
||||||
def onchange_room_id(self):
|
def onchange_room_id(self):
|
||||||
for line in self:
|
for line in self:
|
||||||
@@ -483,7 +485,7 @@ class ReservationWizard(models.TransientModel):
|
|||||||
raise ValidationError(_("This room is occupied!, please, \
|
raise ValidationError(_("This room is occupied!, please, \
|
||||||
choice other room or change the reservation date"))
|
choice other room or change the reservation date"))
|
||||||
|
|
||||||
|
|
||||||
@api.onchange('checkin', 'checkout', 'room_type_id',
|
@api.onchange('checkin', 'checkout', 'room_type_id',
|
||||||
'discount', 'board_service_room_id', 'product_ids')
|
'discount', 'board_service_room_id', 'product_ids')
|
||||||
def onchange_dates(self):
|
def onchange_dates(self):
|
||||||
@@ -574,6 +576,7 @@ class ReservationWizard(models.TransientModel):
|
|||||||
|
|
||||||
class ServiceWizard(models.TransientModel):
|
class ServiceWizard(models.TransientModel):
|
||||||
_name = 'pms.service.wizard'
|
_name = 'pms.service.wizard'
|
||||||
|
_description = 'Virtual Service for Groups'
|
||||||
|
|
||||||
product_id = fields.Many2one('product.product',
|
product_id = fields.Many2one('product.product',
|
||||||
string="Service")
|
string="Service")
|
||||||
@@ -581,7 +584,7 @@ class ServiceWizard(models.TransientModel):
|
|||||||
folio_wizard_id = fields.Many2one('pms.folio.wizard')
|
folio_wizard_id = fields.Many2one('pms.folio.wizard')
|
||||||
discount = fields.Float('discount')
|
discount = fields.Float('discount')
|
||||||
price_unit = fields.Float('Unit Price', required=True,
|
price_unit = fields.Float('Unit Price', required=True,
|
||||||
digits=dp.get_precision('Product Price'),
|
digits=('Product Price'),
|
||||||
default=0.0)
|
default=0.0)
|
||||||
price_total = fields.Float(compute='_compute_amount', string='Total',
|
price_total = fields.Float(compute='_compute_amount', string='Total',
|
||||||
readonly=True, store=True)
|
readonly=True, store=True)
|
||||||
@@ -589,7 +592,7 @@ class ServiceWizard(models.TransientModel):
|
|||||||
domain=['|', ('active', '=', False),
|
domain=['|', ('active', '=', False),
|
||||||
('active', '=', True)])
|
('active', '=', True)])
|
||||||
product_uom_qty = fields.Float(string='Quantity',
|
product_uom_qty = fields.Float(string='Quantity',
|
||||||
digits=dp.get_precision('Product Unit of Measure'),
|
digits=('Product Unit of Measure'),
|
||||||
required=True,
|
required=True,
|
||||||
default=1.0)
|
default=1.0)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user