[IMP] pms-api-rest: demo data for property image hotel, icon room type classes, views, init, manifest & services & datamodels (property, user, room_type_class, agency, sale channels)

This commit is contained in:
miguelpadin
2023-09-06 19:22:21 +02:00
committed by Darío Lodeiros
parent f374f6a102
commit e0fae5f366
23 changed files with 152 additions and 9 deletions

View File

@@ -25,6 +25,7 @@
"data/pms_app_reset_password_template.xml",
"views/pms_property_views.xml",
"views/res_users_views.xml",
"views/pms_room_type_class_views.xml",
],
"demo": [
"demo/pms_api_rest_master_data.xml",

View File

@@ -13,4 +13,4 @@ class PmsAgencyInfo(Datamodel):
_name = "pms.agency.info"
id = fields.Integer(required=True, allow_none=False)
name = fields.String(required=True, allow_none=False)
image = fields.String(required=False, allow_none=True)
imageUrl = fields.String(required=False, allow_none=True)

View File

@@ -29,3 +29,4 @@ class PmsPropertyInfo(Datamodel):
simpleInColor = fields.String(required=False, allow_none=True)
simpleFutureColor = fields.String(required=False, allow_none=True)
language = fields.String(required=True, allow_none=False)
hotelImageUrl = fields.String(required=False, allow_none=True)

View File

@@ -15,3 +15,4 @@ class PmsRoomTypeClassInfo(Datamodel):
name = fields.String(required=False, allow_none=True)
defaultCode = fields.String(required=False, allow_none=True)
pmsPropertyIds = fields.List(fields.Integer(), required=False)
imageUrl = fields.String(required=False, allow_none=True)

View File

@@ -13,4 +13,4 @@ class PmsSaleChannelInfo(Datamodel):
id = fields.Integer(required=True, allow_none=False)
name = fields.String(required=True, allow_none=False)
channelType = fields.String(required=True, allow_none=True)
icon = fields.String(required=False, allow_none=True)
iconUrl = fields.String(required=False, allow_none=True)

View File

@@ -23,6 +23,7 @@ class PmsApiRestUserOutput(Datamodel):
userEmail = fields.String(required=False, allow_none=True)
userPhone = fields.String(required=False, allow_none=True)
userImageBase64 = fields.String(required=False, allow_none=True)
userImageUrl = fields.String(required=False, allow_none=True)
defaultPropertyId = fields.Integer(required=False, allow_none=True)
defaultPropertyName = fields.String(required=False, allow_none=True)
isNewInterfaceUser = fields.Boolean(required=False, allow_none=True)

View File

@@ -13,5 +13,20 @@
eval="[(6, 0, [ref('pms.field_pms_availability_plan_rule__min_stay'), ref('pms.field_pms_availability_plan_rule__quota')])]"
/>
</record>
<record id="pms.main_pms_property" model="pms.property">
<field name="hotel_image_pms_api_rest" type="base64" file="pms_api_rest/demo/pms_property_hotel_image_pms_api_rest_my_property.jpg"/>
</record>
<record id="pms.san_carlos_property" model="pms.property">
<field name="hotel_image_pms_api_rest" type="base64" file="pms_api_rest/demo/pms_property_hotel_image_pms_api_rest_san_carlos.jpg"/>
</record>
<record id="pms.pms_room_type_class_bedroom" model="pms.room.type.class">
<field name="icon_pms_api_rest" type="base64" file="pms_api_rest/demo/pms_room_type_class_icon_pms_api_rest_room.svg"/>
</record>
<record id="pms.pms_room_type_class_conference_room" model="pms.room.type.class">
<field name="icon_pms_api_rest" type="base64" file="pms_api_rest/demo/pms_room_type_class_icon_pms_api_rest_conference.svg"/>
</record>
<record id="pms.pms_room_type_class_parking" model="pms.room.type.class">
<field name="icon_pms_api_rest" type="base64" file="pms_api_rest/demo/pms_room_type_class_icon_pms_api_rest_parking.svg"/>
</record>
</data>
</odoo>

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1080" height="1080" viewBox="0 0 1080 1080" xml:space="preserve">
<desc>Created with Fabric.js 5.2.4</desc>
<defs>
</defs>
<rect x="0" y="0" width="100%" height="100%" fill="transparent"></rect>
<g transform="matrix(1 0 0 1 540 540)" id="64ca0273-1ca4-45cb-b1ab-8594b25df1b0" >
<rect style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1; visibility: hidden;" vector-effect="non-scaling-stroke" x="-540" y="-540" rx="0" ry="0" width="1080" height="1080" />
</g>
<g transform="matrix(1 0 0 1 540 540)" id="c156ec40-c0ee-4e95-aa46-7c2cb98bea3c" >
</g>
<g transform="matrix(11.97 0 0 11.97 540 521.88)" >
<g style="" vector-effect="non-scaling-stroke" >
<g transform="matrix(1 0 0 1 0 18.33)" >
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-50, -68.33)" d="M 50 58.333 C 44.479 58.333 40 62.812 40 68.333 C 40 73.854 44.479 78.333 50 78.333 C 55.521 78.333 60 73.854 60 68.333 C 60 62.813 55.521 58.333 50 58.333 z M 50 71.667 C 48.158 71.667 46.667 70.169 46.667 68.333 C 46.667 66.491 48.158 65 50 65 C 51.843 65 53.333 66.491 53.333 68.333 C 53.333 70.169 51.842999999999996 71.667 50 71.667 z" stroke-linecap="round" />
</g>
<g transform="matrix(1 0 0 1 0 36.67)" >
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-50, -86.67)" d="M 56.667 83.333 L 43.333 83.333 C 39.650999999999996 83.333 36.666 86.318 36.666 90 L 63.333 90 C 63.333 86.318 60.352 83.333 56.667 83.333 z" stroke-linecap="round" />
</g>
<g transform="matrix(1 0 0 1 30 18.33)" >
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-80, -68.33)" d="M 80 58.333 C 74.479 58.333 70 62.812 70 68.333 C 70 73.854 74.479 78.333 80 78.333 C 85.521 78.333 90 73.854 90 68.333 C 90 62.813 85.521 58.333 80 58.333 z M 80 71.667 C 78.157 71.667 76.667 70.169 76.667 68.333 C 76.667 66.491 78.157 65 80 65 C 81.843 65 83.333 66.491 83.333 68.333 C 83.333 70.169 81.843 71.667 80 71.667 z" stroke-linecap="round" />
</g>
<g transform="matrix(1 0 0 1 28.33 36.67)" >
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-78.33, -86.67)" d="M 90 83.333 L 73.333 83.333 C 69.651 83.333 66.667 86.318 66.667 90 L 90 90 z" stroke-linecap="round" />
</g>
<g transform="matrix(1 0 0 1 -30 -30)" >
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-20, -20)" d="M 20 10 C 14.479 10 10 14.479 10 20 C 10 25.521 14.479 30 20 30 C 25.522 30 30 25.521 30 20 C 30 14.479 25.522 10 20 10 z M 20 23.333 C 18.161 23.333 16.668 21.842 16.668 20 C 16.668 18.158 18.16 16.667 20 16.667 C 21.842 16.667 23.332 18.158 23.332 20 C 23.332 21.842 21.842000000000002 23.333 20 23.333 z" stroke-linecap="round" />
</g>
<g transform="matrix(1 0 0 1 13.33 -18.33)" >
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-63.33, -31.67)" d="M 90 10 L 36.667 10 L 36.667 16.667 L 83.333 16.667 L 83.333 46.667 L 36.667 46.667 L 36.667 53.333 L 90 53.333 z" stroke-linecap="round" />
</g>
<g transform="matrix(1 0 0 1 -18.33 9.35)" >
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-31.67, -59.35)" d="M 48.538 28.7 C 43.571 33.838 36.986999999999995 36.667 29.997999999999998 36.667 L 9.999999999999996 36.667 L 9.999999999999996 90 L 16.667999999999996 90 L 16.667999999999996 70 L 23.332999999999995 70 L 23.332999999999995 90 L 29.999999999999993 90 L 29.999999999999993 43.333 C 39.10999999999999 43.333 47.35699999999999 39.510999999999996 53.33299999999999 33.333 z M 23.331999999999997 63.333 L 16.666999999999998 63.333 L 16.666999999999998 43.333 L 23.331999999999997 43.333 z" stroke-linecap="round" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="120" height="120" viewBox="0 0 120 120" xml:space="preserve">
<desc>Created with Fabric.js 5.2.4</desc>
<defs>
</defs>
<rect x="0" y="0" width="100%" height="100%" fill="transparent"></rect>
<g transform="matrix(1 0 0 1 60 60)" id="1b991696-391f-4faf-ae49-e87cd589fef0" >
<rect style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1; visibility: hidden;" vector-effect="non-scaling-stroke" x="-60" y="-60" rx="0" ry="0" width="120" height="120" />
</g>
<g transform="matrix(Infinity NaN NaN Infinity 0 0)" id="6b31938b-5c26-4249-9d63-5d117d3674a5" >
</g>
<g transform="matrix(0.14 0 0 0.17 61.81 58.43)" >
<g style="" vector-effect="non-scaling-stroke" >
<g transform="matrix(2.94 0 0 2.94 -104.16 65.75)" >
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-100.78, -158.66)" d="M 193.26 118.059 C 192.38299999999998 118.059 191.483 118.185 190.583 118.432 L 180.411 121.23400000000001 L 169.85 95.504 C 166.857 88.215 158.012 82.284 150.13299999999998 82.284 L 51.28299999999999 82.284 C 43.402999999999984 82.284 34.55899999999998 88.215 31.566999999999986 95.504 L 21.018999999999984 121.19800000000001 L 10.972999999999985 118.43100000000001 C 10.073999999999984 118.18400000000001 9.173999999999985 118.058 8.296999999999985 118.058 C 3.488999999999985 118.058 -1.5987211554602254e-14 121.73100000000001 -1.5987211554602254e-14 126.79 L -1.5987211554602254e-14 132.786 C -1.5987211554602254e-14 138.692 4.805999999999984 143.498 10.711999999999984 143.498 L 11.862999999999984 143.498 L 10.157999999999983 147.65099999999998 C 7.377999999999984 154.421 5.114999999999983 165.88699999999997 5.114999999999983 173.20899999999997 L 5.114999999999983 224.32399999999998 C 5.114999999999983 230.23 9.920999999999983 235.03599999999997 15.826999999999984 235.03599999999997 L 29.816999999999986 235.03599999999997 C 35.722999999999985 235.03599999999997 40.52899999999998 230.22999999999996 40.52899999999998 224.32399999999998 L 40.52899999999998 211.55999999999997 L 160.88599999999997 211.55999999999997 L 160.88599999999997 224.32399999999998 C 160.88599999999997 230.23 165.69199999999998 235.03599999999997 171.59799999999996 235.03599999999997 L 185.58599999999996 235.03599999999997 C 191.49199999999996 235.03599999999997 196.29799999999994 230.22999999999996 196.29799999999994 224.32399999999998 L 196.29799999999994 173.21 C 196.29799999999994 165.889 194.03499999999994 154.423 191.25499999999994 147.65200000000002 L 189.54999999999993 143.49900000000002 L 190.84399999999994 143.49900000000002 C 196.74999999999994 143.49900000000002 201.55599999999993 138.693 201.55599999999993 132.78700000000003 L 201.55599999999993 126.79100000000004 C 201.557 121.732 198.067 118.059 193.26 118.059 z M 28.698 137.681 L 44.676 98.763 C 46.466 94.403 51.786 90.83500000000001 56.499 90.83500000000001 L 144.917 90.83500000000001 C 149.63 90.83500000000001 154.95 94.40200000000002 156.74 98.763 L 172.71800000000002 137.681 C 174.507 142.04100000000003 172.116 145.609 167.40300000000002 145.609 L 34.014 145.609 C 29.3 145.608 26.909 142.041 28.698 137.681 z M 64.365 186.908 C 64.365 189.265 62.43599999999999 191.19199999999998 60.080999999999996 191.19199999999998 L 29.729 191.19199999999998 C 27.372 191.19199999999998 25.444 189.26399999999998 25.444 186.908 L 25.444 172.34199999999998 C 25.444 169.986 27.372 168.058 29.729 168.058 L 60.081 168.058 C 62.436 168.058 64.36500000000001 169.986 64.36500000000001 172.34199999999998 L 64.36500000000001 186.908 z M 175.684 186.908 C 175.684 189.265 173.755 191.19199999999998 171.4 191.19199999999998 L 141.048 191.19199999999998 C 138.693 191.19199999999998 136.764 189.26399999999998 136.764 186.908 L 136.764 172.34199999999998 C 136.764 169.986 138.693 168.058 141.048 168.058 L 171.4 168.058 C 173.755 168.058 175.684 169.986 175.684 172.34199999999998 L 175.684 186.908 z" stroke-linecap="round" />
</g>
<g transform="matrix(2.94 0 0 2.94 286.2 -1.68)" >
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-233.76, -135.69)" d="M 259.125 37.486 L 208.39 37.486 C 201.00199999999998 37.486 194.992 43.497 194.992 50.884 L 194.992 101.62 C 194.992 109.00800000000001 201.003 115.019 208.39 115.019 L 228.75699999999998 115.019 L 228.75699999999998 228.89100000000002 C 228.75699999999998 231.65300000000002 230.99499999999998 233.89100000000002 233.75699999999998 233.89100000000002 C 236.51899999999998 233.89100000000002 238.75699999999998 231.65300000000002 238.75699999999998 228.89100000000002 L 238.75699999999998 115.02 L 259.125 115.02 C 266.513 115.02 272.523 109.009 272.523 101.621 L 272.523 50.885 C 272.523 43.497 266.513 37.486 259.125 37.486 z M 247.634 79.553 C 244.71599999999998 82.17999999999999 240.41799999999998 83.512 234.85999999999999 83.512 L 227.51299999999998 83.512 C 226.63099999999997 83.512 225.91299999999998 84.231 225.91299999999998 85.113 L 225.91299999999998 97.502 C 225.91299999999998 98.848 224.81799999999998 99.942 223.47199999999998 99.942 L 217.908 99.942 C 216.56099999999998 99.942 215.46699999999998 98.847 215.46699999999998 97.502 L 215.46699999999998 55.007 C 215.46699999999998 53.66 216.56199999999998 52.565 217.908 52.565 L 231.92399999999998 52.565 C 241.20899999999997 52.565 244.67499999999998 53.964 247.52299999999997 56.381 C 250.52699999999996 58.93 252.04899999999998 62.834 252.04899999999998 67.987 C 252.048 73.022 250.564 76.912 247.634 79.553 z" stroke-linecap="round" />
</g>
<g transform="matrix(2.94 0 0 2.94 286.3 -200.47)" >
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-233.79, -67.97)" d="M 239.681 62.825 C 238.32500000000002 61.801 235.92600000000002 61.281000000000006 232.55200000000002 61.281000000000006 L 227.51300000000003 61.281000000000006 C 226.63100000000003 61.281000000000006 225.91300000000004 61.99900000000001 225.91300000000004 62.88 L 225.91300000000004 73.062 C 225.91300000000004 73.943 226.63100000000003 74.661 227.51300000000003 74.661 L 230.53200000000004 74.661 C 231.64100000000005 74.661 233.43300000000005 74.57900000000001 234.52600000000004 74.478 C 235.58700000000005 74.381 238.58200000000005 73.94699999999999 239.68100000000004 73.11699999999999 C 241.00000000000003 72.11899999999999 241.66900000000004 70.39299999999999 241.66900000000004 67.98799999999999 C 241.669 65.56 241 63.823 239.681 62.825 z" stroke-linecap="round" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.2 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@@ -2,3 +2,5 @@ from . import pms_property
from . import res_users
from . import account_payment
from . import sql_export
from . import pms_room_type_class

View File

@@ -88,3 +88,8 @@ class PmsProperty(models.Model):
help="Color for pending payment reservations in the planning.",
default="rgba(4, 95, 118)",
)
hotel_image_pms_api_rest = fields.Image(
string="Hotel image",
store=True,
)

View File

@@ -0,0 +1,10 @@
from odoo import fields, models
class PmsRoomTypeClass(models.Model):
_inherit = "pms.room.type.class"
icon_pms_api_rest = fields.Image(
string="Icon room type class image",
store=True,
)

View File

@@ -0,0 +1,19 @@
from odoo import http
def url_image(context, model, record_id, field):
rt_image_attach = context.env['ir.attachment'].sudo().search([
('res_model', '=', model),
('res_id', '=', record_id),
('res_field', '=', field),
])
if rt_image_attach and not rt_image_attach.access_token:
rt_image_attach.generate_access_token()
result = (
http.request.env['ir.config_parameter']
.sudo().get_param('web.base.url') +
'/web/image/%s?access_token=%s' % (
rt_image_attach.id, rt_image_attach.access_token
) if rt_image_attach else False
)
return result if result else ''

View File

@@ -1,4 +1,5 @@
from odoo import _
from odoo.addons.pms_api_rest.services.manage_url_images import url_image
from odoo.exceptions import MissingError
from odoo.addons.base_rest import restapi
@@ -41,9 +42,7 @@ class PmsAgencyService(Component):
PmsAgencyInfo(
id=agency.id,
name=agency.name,
image=agency.image_1024.decode("utf-8")
if agency.image_1024
else None,
imageUrl=url_image(self, 'res.partner', agency.id, 'image_128'),
)
)
return result_agencies
@@ -72,7 +71,7 @@ class PmsAgencyService(Component):
return PmsAgencieInfo(
id=agency.id,
name=agency.name if agency.name else None,
image=agency.image_1024.decode("utf-8") if agency.image_1024 else None,
imageUrl=url_image(self, 'res.partner', agency.id, 'image_128'),
)
else:
raise MissingError(_("Agency not found"))

View File

@@ -9,6 +9,7 @@ from odoo.exceptions import AccessDenied
from odoo.addons.base_rest import restapi
from odoo.addons.base_rest_datamodel.restapi import Datamodel
from odoo.addons.component.core import Component
from .manage_url_images import url_image
class PmsLoginService(Component):
@@ -80,6 +81,7 @@ class PmsLoginService(Component):
userImageBase64=user_record.partner_id.image_1024
if user_record.partner_id.image_1024
else None,
userImageUrl=url_image(self, 'res.partner', user_record.partner_id.id, 'image_1024'),
isNewInterfaceUser=user_record.is_new_interface_app_user,
availabilityRuleFields=avail_rule_names,
)

View File

@@ -1,6 +1,7 @@
from odoo.addons.base_rest import restapi
from odoo.addons.base_rest_datamodel.restapi import Datamodel
from odoo.addons.component.core import Component
from odoo.addons.pms_api_rest.services.manage_url_images import url_image
class PmsPropertyService(Component):
@@ -48,6 +49,7 @@ class PmsPropertyService(Component):
simpleInColor=prop.simple_in_color,
simpleFutureColor=prop.simple_future_color,
language=prop.lang,
hotelImageUrl=url_image(self, 'pms.property', prop.id, 'hotel_image_pms_api_rest'),
)
)
return result_properties

View File

@@ -1,6 +1,7 @@
from odoo.addons.base_rest import restapi
from odoo.addons.base_rest_datamodel.restapi import Datamodel
from odoo.addons.component.core import Component
from .manage_url_images import url_image
class PmsRoomTypeClassService(Component):
@@ -51,6 +52,7 @@ class PmsRoomTypeClassService(Component):
name=room.name,
defaultCode=room.default_code if room.default_code else None,
pmsPropertyIds=room.pms_property_ids.mapped("id"),
imageUrl=url_image(self, 'pms.room.type.class', room.id, 'icon_pms_api_rest'),
)
)
return result_room_type_class

View File

@@ -1,4 +1,5 @@
from odoo import _
from odoo.addons.pms_api_rest.services.manage_url_images import url_image
from odoo.exceptions import MissingError
from odoo.addons.base_rest import restapi
@@ -62,9 +63,7 @@ class PmsSaleChannelService(Component):
channelType=sale_channel.channel_type
if sale_channel.channel_type
else None,
icon=sale_channel.icon
if sale_channel.icon
else None,
iconUrl=url_image(self, 'pms.sale.channel', sale_channel.id, 'icon'),
)
)
return result_sale_channels

View File

@@ -4,6 +4,11 @@
<field name="model">pms.property</field>
<field name="inherit_id" ref="pms.pms_property_views_form" />
<field name="arch" type="xml">
<xpath expr="//page[@name='property_general']//field[@name='street']" position="before">
<group>
<field name="hotel_image_pms_api_rest" widget="image" class="oe_avatar"/>
</group>
</xpath>
<xpath expr="//field[@name='default_departure_hour']" position="after">
<group string="Planning Colors">
<field name="color_option_config" />

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="inherit_pms_room_type_class_views" model="ir.ui.view">
<field name="model">pms.room.type.class</field>
<field name="inherit_id" ref="pms.pms_room_type_class_view_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='overnight']" position="after">
<field name="icon_pms_api_rest" widget="image" class="oe_avatar"/>
</xpath>
</field>
</record>
</odoo>