mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[REF]pms_api_rest: changed property colors from module pms to module pms_api_rest
This commit is contained in:
@@ -238,85 +238,6 @@ class PmsProperty(models.Model):
|
||||
default=get_default_logo(),
|
||||
)
|
||||
|
||||
color_option_config = fields.Selection(
|
||||
string="Color Option Configuration",
|
||||
help="Configuration of the color code for the planning.",
|
||||
selection=[("simple", "Simple"), ("advanced", "Advanced")],
|
||||
default="simple",
|
||||
)
|
||||
|
||||
simple_out_color = fields.Char(
|
||||
string="Reservations Outside",
|
||||
help="Color for done reservations in the planning.",
|
||||
default="rgba(94,208,236)",
|
||||
)
|
||||
|
||||
simple_in_color = fields.Char(
|
||||
string="Reservations Inside",
|
||||
help="Color for onboard and departure_delayed reservations in the planning.",
|
||||
default="rgba(0,146,183)",
|
||||
)
|
||||
|
||||
simple_future_color = fields.Char(
|
||||
string="Future Reservations",
|
||||
help="Color for confirm, arrival_delayed and draft reservations in the planning.",
|
||||
default="rgba(1,182,227)",
|
||||
)
|
||||
|
||||
pre_reservation_color = fields.Char(
|
||||
string="Pre-Reservation",
|
||||
help="Color for draft reservations in the planning.",
|
||||
default="rgba(162,70,128)",
|
||||
)
|
||||
|
||||
confirmed_reservation_color = fields.Char(
|
||||
string="Confirmed Reservation",
|
||||
default="rgba(1,182,227)",
|
||||
help="Color for confirm reservations in the planning.",
|
||||
)
|
||||
|
||||
paid_reservation_color = fields.Char(
|
||||
string="Paid Reservation",
|
||||
help="Color for done paid reservations in the planning.",
|
||||
default="rgba(126,126,126)",
|
||||
)
|
||||
|
||||
on_board_reservation_color = fields.Char(
|
||||
string="Checkin",
|
||||
help="Color for onboard not paid reservations in the planning.",
|
||||
default="rgba(255,64,64)",
|
||||
)
|
||||
|
||||
paid_checkin_reservation_color = fields.Char(
|
||||
string="Paid Checkin",
|
||||
help="Color for onboard paid reservations in the planning.",
|
||||
default="rgba(130,191,7)",
|
||||
)
|
||||
|
||||
out_reservation_color = fields.Char(
|
||||
string="Checkout",
|
||||
help="Color for done not paid reservations in the planning.",
|
||||
default="rgba(88,77,118)",
|
||||
)
|
||||
|
||||
staff_reservation_color = fields.Char(
|
||||
string="Staff",
|
||||
help="Color for staff reservations in the planning.",
|
||||
default="rgba(192,134,134)",
|
||||
)
|
||||
|
||||
to_assign_reservation_color = fields.Char(
|
||||
string="OTA Reservation To Assign",
|
||||
help="Color for to_assign reservations in the planning.",
|
||||
default="rgba(237,114,46,)",
|
||||
)
|
||||
|
||||
pending_payment_reservation_color = fields.Char(
|
||||
string="Payment Pending",
|
||||
help="Color for pending payment reservations in the planning.",
|
||||
default="rgba(162,70,137)",
|
||||
)
|
||||
|
||||
@api.depends_context(
|
||||
"checkin",
|
||||
"checkout",
|
||||
|
||||
@@ -85,73 +85,6 @@
|
||||
<field name="default_arrival_hour" />
|
||||
<field name="default_departure_hour" />
|
||||
</group>
|
||||
<group string="Planning Colors">
|
||||
<field name="color_option_config" />
|
||||
</group>
|
||||
<group>
|
||||
<field
|
||||
name="simple_in_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'simple')]}"
|
||||
/>
|
||||
<field
|
||||
name="simple_out_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'simple')]}"
|
||||
/>
|
||||
<field
|
||||
name="simple_future_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'simple')]}"
|
||||
/>
|
||||
</group>
|
||||
<group colspan="4" col="4">
|
||||
<field
|
||||
name="pre_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="out_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="confirmed_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="paid_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="staff_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="on_board_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="to_assign_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="paid_checkin_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="pending_payment_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
</group>
|
||||
<group string="Print in cardex">
|
||||
<field name="cardex_warning" />
|
||||
</group>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from . import controllers
|
||||
from . import datamodels
|
||||
from . import services
|
||||
from . import models
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
"external_dependencies": {
|
||||
"python": ["jwt", "simplejson", "marshmallow", "jose"],
|
||||
},
|
||||
"data": ["data/auth_jwt_validator.xml"],
|
||||
"data": [
|
||||
"data/auth_jwt_validator.xml",
|
||||
"views/pms_property_views.xml",
|
||||
],
|
||||
"installable": True,
|
||||
}
|
||||
|
||||
1
pms_api_rest/models/__init__.py
Normal file
1
pms_api_rest/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import pms_property
|
||||
84
pms_api_rest/models/pms_property.py
Normal file
84
pms_api_rest/models/pms_property.py
Normal file
@@ -0,0 +1,84 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class PmsProperty(models.Model):
|
||||
_inherit = "pms.property"
|
||||
|
||||
color_option_config = fields.Selection(
|
||||
string="Color Option Configuration",
|
||||
help="Configuration of the color code for the planning.",
|
||||
selection=[("simple", "Simple"), ("advanced", "Advanced")],
|
||||
default="simple",
|
||||
)
|
||||
|
||||
simple_out_color = fields.Char(
|
||||
string="Reservations Outside",
|
||||
help="Color for done reservations in the planning.",
|
||||
default="rgba(94,208,236)",
|
||||
)
|
||||
|
||||
simple_in_color = fields.Char(
|
||||
string="Reservations Inside",
|
||||
help="Color for onboard and departure_delayed reservations in the planning.",
|
||||
default="rgba(0,146,183)",
|
||||
)
|
||||
|
||||
simple_future_color = fields.Char(
|
||||
string="Future Reservations",
|
||||
help="Color for confirm, arrival_delayed and draft reservations in the planning.",
|
||||
default="rgba(1,182,227)",
|
||||
)
|
||||
|
||||
pre_reservation_color = fields.Char(
|
||||
string="Pre-Reservation",
|
||||
help="Color for draft reservations in the planning.",
|
||||
default="rgba(162,70,128)",
|
||||
)
|
||||
|
||||
confirmed_reservation_color = fields.Char(
|
||||
string="Confirmed Reservation",
|
||||
default="rgba(1,182,227)",
|
||||
help="Color for confirm reservations in the planning.",
|
||||
)
|
||||
|
||||
paid_reservation_color = fields.Char(
|
||||
string="Paid Reservation",
|
||||
help="Color for done paid reservations in the planning.",
|
||||
default="rgba(126,126,126)",
|
||||
)
|
||||
|
||||
on_board_reservation_color = fields.Char(
|
||||
string="Checkin",
|
||||
help="Color for onboard not paid reservations in the planning.",
|
||||
default="rgba(255,64,64)",
|
||||
)
|
||||
|
||||
paid_checkin_reservation_color = fields.Char(
|
||||
string="Paid Checkin",
|
||||
help="Color for onboard paid reservations in the planning.",
|
||||
default="rgba(130,191,7)",
|
||||
)
|
||||
|
||||
out_reservation_color = fields.Char(
|
||||
string="Checkout",
|
||||
help="Color for done not paid reservations in the planning.",
|
||||
default="rgba(88,77,118)",
|
||||
)
|
||||
|
||||
staff_reservation_color = fields.Char(
|
||||
string="Staff",
|
||||
help="Color for staff reservations in the planning.",
|
||||
default="rgba(192,134,134)",
|
||||
)
|
||||
|
||||
to_assign_reservation_color = fields.Char(
|
||||
string="OTA Reservation To Assign",
|
||||
help="Color for to_assign reservations in the planning.",
|
||||
default="rgba(237,114,46,)",
|
||||
)
|
||||
|
||||
pending_payment_reservation_color = fields.Char(
|
||||
string="Payment Pending",
|
||||
help="Color for pending payment reservations in the planning.",
|
||||
default="rgba(162,70,137)",
|
||||
)
|
||||
78
pms_api_rest/views/pms_property_views.xml
Normal file
78
pms_api_rest/views/pms_property_views.xml
Normal file
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="inherit_pms_property_views" model="ir.ui.view">
|
||||
<field name="model">pms.property</field>
|
||||
<field name="inherit_id" ref="pms.pms_property_views_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='default_departure_hour']" position="after">
|
||||
<group string="Planning Colors">
|
||||
<field name="color_option_config" />
|
||||
<group>
|
||||
<field
|
||||
name="simple_in_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'simple')]}"
|
||||
/>
|
||||
<field
|
||||
name="simple_out_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'simple')]}"
|
||||
/>
|
||||
<field
|
||||
name="simple_future_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'simple')]}"
|
||||
/>
|
||||
</group>
|
||||
<group colspan="4" col="4">
|
||||
<field
|
||||
name="pre_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="out_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="confirmed_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="paid_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="staff_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="on_board_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="to_assign_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="paid_checkin_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
<field
|
||||
name="pending_payment_reservation_color"
|
||||
widget="color"
|
||||
attrs="{'invisible': [('color_option_config', '!=', 'advanced')]}"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user