Add data function available_by_cl... and add apps
This commit is contained in:
parent
8af7575f29
commit
ae920fa216
|
@ -96,6 +96,7 @@ def register():
|
|||
dash.AppHousekeeping,
|
||||
dash.AppWebCheckIn,
|
||||
dash.AppBooking,
|
||||
dash.AppWebBooking,
|
||||
invoice.InvoiceLine,
|
||||
invoice.Invoice,
|
||||
room.HotelTask,
|
||||
|
@ -110,6 +111,7 @@ def register():
|
|||
rate_plan.RatePlan,
|
||||
rate_plan.RatePlanRule,
|
||||
siat.SiatSyncStart,
|
||||
dash.AppWebMelHous,
|
||||
module='hotel', type_='model')
|
||||
Pool.register(
|
||||
booking.BookingReport,
|
||||
|
|
13
dash.py
13
dash.py
|
@ -16,6 +16,8 @@ class DashApp(metaclass=PoolMeta):
|
|||
"dash.app.housekeeping",
|
||||
"dash.app.web_checkin",
|
||||
"dash.app.booking",
|
||||
"dash.app.web_booking",
|
||||
"dash.app.web_melhous",
|
||||
]
|
||||
)
|
||||
return origins
|
||||
|
@ -29,6 +31,8 @@ class DashApp(metaclass=PoolMeta):
|
|||
("housekeeping", "Housekeeping"),
|
||||
("web_checkin", "Web Checkin"),
|
||||
("booking", "Booking"),
|
||||
("web_booking", "Web Booking"),
|
||||
("web_melhous", "Web Melhous"),
|
||||
]
|
||||
)
|
||||
return options
|
||||
|
@ -52,3 +56,12 @@ class AppWebCheckIn(DashAppBase):
|
|||
class AppBooking(DashAppBase):
|
||||
"App Booking"
|
||||
__name__ = "dash.app.booking"
|
||||
|
||||
class AppWebBooking(DashAppBase):
|
||||
"App Web Booking"
|
||||
__name__ = "dash.app.web_booking"
|
||||
|
||||
class AppWebMelHous(DashAppBase):
|
||||
"App Web Melhous"
|
||||
__name__ = "dash.app.web_melhous"
|
||||
|
27
dash.xml
27
dash.xml
|
@ -95,5 +95,30 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="method">report_month_occupancy_rate</field>
|
||||
</record>
|
||||
|
||||
<record model="dash.app.web_booking" id="dash_app_web_booking">
|
||||
<field name="company">1</field>
|
||||
<field name="icon">key</field>
|
||||
<field name="kind">external</field>
|
||||
</record>
|
||||
<record model="dash.app" id="app_web_booking">
|
||||
<field name="name">Web Booking</field>
|
||||
<field name="origin">dash.app.web_booking,1</field>
|
||||
<field name="active">True</field>
|
||||
<field name="app_name">web_booking</field>
|
||||
</record>
|
||||
|
||||
<record model="dash.app.web_melhous" id="dash_app_web_melhous">
|
||||
<field name="company">1</field>
|
||||
<field name="icon">key</field>
|
||||
<field name="kind">external</field>
|
||||
</record>
|
||||
<record model="dash.app" id="app_web_melhous">
|
||||
<field name="name">Web Melhous</field>
|
||||
<field name="origin">dash.app.web_melhous,1</field>
|
||||
<field name="active">True</field>
|
||||
<field name="app_name">web_melhous</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</tryton>
|
||||
</tryton>
|
8
room.py
8
room.py
|
@ -192,14 +192,17 @@ class Room(Workflow, ModelSQL, ModelView):
|
|||
product = room.main_accommodation.products[0]
|
||||
_room = {
|
||||
"id": room.id,
|
||||
"name": room.name
|
||||
"name": room.name,
|
||||
"max_accommodation": room.max_accommodation,
|
||||
"amenities": [{"name": ame.name, "type_icon": ame.type_icon} for ame in room.amenities]
|
||||
|
||||
}
|
||||
try:
|
||||
clssf[product.id]['available'].append(1)
|
||||
clssf[product.id]['rooms'].append(_room)
|
||||
except:
|
||||
clssf[product.id] = {
|
||||
"product": {"id": product.id, "name": product.name},
|
||||
"product": {"id": product.id, "name": product.name, "images": [img.image_url for img in product.images]},
|
||||
"sale_price_taxed": product.sale_price_taxed,
|
||||
"available": [1],
|
||||
"rooms": [_room],
|
||||
|
@ -315,6 +318,7 @@ class Amenities(ModelSQL, ModelView):
|
|||
__name__ = 'hotel.amenities'
|
||||
_rec_name = 'name'
|
||||
name = fields.Char('Name', required=True)
|
||||
type_icon = fields.Char('Type icon')
|
||||
notes = fields.Text('Notes')
|
||||
type = fields.Selection([
|
||||
('', ''),
|
||||
|
|
|
@ -6,6 +6,8 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="name"/>
|
||||
<label name="type"/>
|
||||
<field name="type"/>
|
||||
<label name="type_icon"/>
|
||||
<field name="type_icon"/>
|
||||
<separator name="notes" colspan="4"/>
|
||||
<field name="notes" colspan="4"/>
|
||||
<field name="cleaning_days" colspan="4"
|
||||
|
|
Loading…
Reference in New Issue