Merge branch '11.0' into hotel_node_master

This commit is contained in:
Pablo
2018-11-10 21:00:05 +01:00
64 changed files with 368 additions and 787 deletions

View File

@@ -15,7 +15,7 @@ addons:
env:
global:
- VERSION="11.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0" UNIT_TEST="0"
- VERSION="11.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0" MAKEPOT="0"
# - TRANSIFEX_USER='transbot@odoo-community.org'
# - secure: "XLhGdCIh86zcqww9qBpnk8Xqsf1Pcgw9SKr7X0KYBHJofHj4Z6Kq/oVFjpZ1LSjadsaABKbwY7h4hvKEpxZwptCv+fNTOKYy7hXFLGYnDeNeWu4zA4LI7TA5uPvyZjZ+g2xc+9dzR/VbfRHNqjvmgiEidxxqLeOnNFZ5CHdOdCw="
matrix:
@@ -27,14 +27,14 @@ env:
install:
- git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools --depth=1
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly
- git clone -b ${VERSION} https://github.com/OCA/web.git ${HOME}/dependencies/web --depth=1
- git clone -b ${VERSION} https://github.com/OCA/partner-contact.git ${HOME}/dependencies/partner-contact --depth=1
- git clone -b ${VERSION} https://github.com/OCA/account-payment.git ${HOME}/dependencies/account_payment_return --depth=1
- git clone -b ${VERSION} https://github.com/OCA/account-payment.git ${HOME}/dependencies/account-payment --depth=1
- git clone -b ${VERSION} https://github.com/OCA/connector.git ${HOME}/dependencies/connector --depth=1
- git clone -b ${VERSION} https://github.com/OCA/queue.git ${HOME}/dependencies/queue --depth=1
- pip install odoorpc
- pip install cachetools
- pip install cachetools>=2.0.1
- travis_install_nightly
script:
- travis_wait travis_run_tests

View File

@@ -1,27 +1,18 @@
# HOOTEL PROJECT MODULES [![Build Status](https://travis-ci.org/hootel/hootel.svg?branch=10.0)](https://travis-ci.org/hootel/hootel) [![codecov](https://codecov.io/gh/hootel/hootel/branch/10.0/graph/badge.svg)](https://codecov.io/gh/hootel/hootel) ![Unstable](https://img.shields.io/badge/stability-unstable-yellow.svg)
# HOOTEL PROJECT MODULES [![Build Status](https://travis-ci.org/hootel/hootel.svg?branch=11.0)](https://travis-ci.org/hootel/hootel) [![codecov](https://codecov.io/gh/hootel/hootel/branch/11.0/graph/badge.svg)](https://codecov.io/gh/hootel/hootel) ![Unstable](https://img.shields.io/badge/stability-unstable-yellow.svg)
**IMPORTANT:**
- Set time zone of users that use the calendar
**MODULES:**
- [x] hotel: Base module (Inspired by the work of SerpentCS Hotel Module)
- [x] hotel_calendar: Adds calendar for manage hotel reservations and rooms configuration
- [x] hotel_calendar_wubook: Unify 'hotel_wubook_prototype' and 'hotel_calendar' modules
- [x] hotel_data_bi: Export reservations data for Revenue to MyDataBI
- [x] hotel_l10n_es: Procedures for check-in process in Spain
- [ ] hotel_wubook: NOTHING... the idea is use Odoo Connector
- [x] hotel_wubook_prototype: Current implementation of Wubook Connector... sync data with wubook.net account.
- [ ] hotel_node_slave: Configure a node as a slave to serve and get information from a master one
- [ ] hotel: Base module (Manage Rooms, Reservations, Services, Customers, Mailing, Invoicing, ...)
- [ ] hotel_calendar: Adds calendar for manage hotel reservations and rooms configuration
- [ ] hotel_calendar_channel_connector: Unify 'hotel_channel_connector' and 'hotel_calendar' modules
- [ ] hotel_channel_connector: Base Channel Connector (Using Odoo Connector)
- [ ] hotel_channel_connector_wubook: Wubook API Implementation
- [ ] hotel_node_helper: Configure a node as a helper to serve and get information from a master one
- [ ] hotel_node_master: Configure a node as a master
- [ ] glasof_exporter: Export Odoo data to Glasof xls format
- [x] hotel_revenue: Export Odoo data for Revenue in xls format
- [x] cash_daily_report: Export Odoo Payments & Payment Returns to xls format
- [x] invoice_payments_report: Add payments info in invoices
- [x] theme_chatter_right: Puts chatter to the right
- [x] report_qweb_pdf_preview: Adds new report_type to generate pdf and launch preview/print process
- [x] l10n_es_events_scraper: Gets info about relevant events in Spain
**HOW WORKS?**
- The idea is... the hotel sell 'virtual rooms' and the customer is assigned to one 'normal room'.
- The folio have all reservation lines, used services...
- The idea is... the hotel sell 'rooms types' and the customer is assigned to one 'real room'.
- The folio have all reservation lines, used services, etc..

View File

@@ -12,11 +12,11 @@
<field name="checkin" required="1" colspan="1"/>
<field name="checkout" required="1" colspan="1"/>
</group>
<group>
<group>
<field name="call_center" invisible="1" />
<field name="channel_type" required="1" attrs="{'readonly':[('call_center','=',True)]}"/>
<field name="partner_id"/>
</group>
</group>
</group>
<group>
<field name="room_type_wizard_ids" nolabel="1"
@@ -28,32 +28,32 @@
<field name="min_stay" />
<field name="max_rooms" />
<field name="room_type_id" string="Room Type" readonly="1"/>
<field name="rooms_num" attrs="{'readonly': [('can_confirm','=',False)]}" />
<field name="rooms_num" attrs="{'readonly': [('can_confirm','=',False)]}" />
<field name="checkin" widget="date" />
<field name="checkout" widget="date" />
<field name="discount" attrs="{'readonly': [('can_confirm','=',False)]}"/>
<field name="price" attrs="{'readonly': [('can_confirm','=',False)]}"/>
<field name="price" attrs="{'readonly': [('can_confirm','=',False)]}"/>
<field name="amount_reservation" readonly="1" />
<field name="total_price" invisible="1" />
<field name="can_confirm" invisible="1" />
</tree>
</field>
</field>
</group>
<label for="autoassign" attrs="{'invisible': [('autoassign','=', False)]}"/>
<field name="autoassign" attrs="{'invisible': [('autoassign','=', False)]}"/>
<field name="confirm" invisible="1"/>
<group colspan="2" class="oe_subtotal_footer">
<field name="total"/>
</group>
<field name="total"/>
</group>
<group>
<field name="reservation_wizard_ids" colspan="4" string="Room Lines"
nolabel="1" attrs="{'invisible': [('autoassign','=',True)]}">
<tree string="Room Line" delete="false" editable="buttom">
<field name="product_id" string="Room No" options="{'no_create': True}"/>
<field name="product_id" string="Room No" options="{'no_create': True}"/>
<field name="room_type_id" options="{'no_create': True}" />
<field name="checkin" />
<field name="checkout" />
<field name="nights" />
<field name="nights" />
<field name="adults" />
<field name="children" />
<field name="discount" />
@@ -64,25 +64,25 @@
<field name="to_read" invisible="1" />
<field name="to_assign" invisible="1" />
</tree>
</field>
</field>
</group>
<group>
<field name="service_wizard_ids" colspan="4" string="Services"
nolabel="1" >
<tree string="Services" editable="buttom">
<field name="product_id" string="Service" options="{'no_create': True}"
domain="[('isservice','=',True)]"/>
domain="[('isservice','=',True)]"/>
<field name="product_uom_qty" />
<field name="price_unit" />
<field name="discount" />
<field name="discount" />
<field name="price_total" />
</tree>
</field>
</field>
</group>
<footer>
<footer>
<button name="create_folio" string="Create Reservations" type="object"
class="oe_highlight" />
</footer>
</footer>
</sheet>
</form>
</field>
@@ -92,7 +92,7 @@
<field name="name">Hotel Reservation Wizard</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hotel.folio.wizard</field>
<field name="view_id" ref="hotel_folio_wizard"/>
<field name="view_id" ref="hotel.hotel_folio_wizard"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>

View File

@@ -22,14 +22,12 @@
'data': [
'views/general.xml',
'views/actions.xml',
'views/res_config_views.xml',
'views/inherited_res_users_views.xml',
'views/inherited_hotel_room_type_views.xml',
'views/inherited_hotel_room_views.xml',
'views/room_pricelist_cached_views.xml',
'views/hotel_reservation_views.xml',
'views/hotel_calendar_management_views.xml',
'data/views.xml',
'data/menus.xml',
'data/records.xml',
'security/ir.model.access.csv',

View File

@@ -6,7 +6,7 @@
<record id="hotel_calendar_view" model="ir.ui.view">
<field name="name">Hotel Calendar</field>
<field name="model">hotel.reservation</field>
<field name="inherit_id" ref="hotel.view_hotel_reservation_form" />
<field name="inherit_id" ref="hotel.hotel_reservation_view_form" />
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="." position="inside">
@@ -15,7 +15,7 @@
</field>
</record>
<record id="hotel_calendar_management_view" model="ir.ui.view">
<record id="hotel_calendar_management_view_form" model="ir.ui.view">
<field name="name">Hotel Calendar Management</field>
<field name="model">hotel.calendar.management</field>
<field name="type">form</field>

View File

@@ -1,18 +1,17 @@
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import inherited_hotel_reservation
from . import inherited_product_pricelist_item
from . import inherited_res_users
from . import bus_hotel_calendar
from . import room_pricelist_cached
from . import hotel_calendar_management
from . import res_config
from . import inherited_hotel_reservation
from . import inherited_product_pricelist_item
from . import inherited_res_users
from . import inherited_hotel_room
from . import inherited_hotel_room_type
from . import inherited_hotel_room_type_restriction_item
from . import inherited_hotel_room_type_availability
from . import inherited_product_pricelist
from . import inherited_hotel_folio
from . import inherited_ir_default
from . import inherited_ir_actions_act_window_view
from . import inherited_ir_ui_view
from . import ir_default
from . import ir_actions_act_window_view
from . import ir_ui_view

View File

@@ -113,7 +113,6 @@ class BusHotelCalendar(models.TransientModel):
vals['room_type_id']: {
date_dt.strftime("%d/%m/%Y"): [
vals['avail'],
vals['no_ota'],
vals['id'],
],
},

View File

@@ -40,7 +40,6 @@ class HotelCalendarManagement(models.TransientModel):
avail['date'], avail['date'], room_type_id=room_type.id))
ravail = min(cavail, room_type.total_rooms_count, int(avail['avail']))
vals = {
'no_ota': avail['no_ota'],
'avail': ravail,
}
return vals
@@ -170,11 +169,20 @@ class HotelCalendarManagement(models.TransientModel):
})
return json_data
@api.model
def _generate_avalaibility_data(self, room_type, date, avail):
return {
'id': avail and avail.id or False,
'date': avail and avail.date or date,
'avail': avail and avail.avail or room_type.total_rooms_count,
}
@api.model
def _hcalendar_availability_json_data(self, dfrom, dto):
date_start = fields.Date.from_string(dfrom)
date_end = fields.Date.from_string(dto)
date_diff = abs((date_end - date_start).days) + 1
hotel_room_type_avail_obj = self.env['hotel.room.type.availability']
room_types = self.env['hotel.room.type'].search([])
json_data = {}
@@ -183,24 +191,12 @@ class HotelCalendarManagement(models.TransientModel):
for i in range(0, date_diff):
cur_date = date_start + timedelta(days=i)
cur_date_str = cur_date.strftime(DEFAULT_SERVER_DATE_FORMAT)
avail = self.env['hotel.room.type.availability'].search([
avail = hotel_room_type_avail_obj.search([
('date', '=', cur_date_str),
('room_type_id', '=', room_type.id)
])
if avail:
json_data[room_type.id].append({
'id': avail.id,
'date': avail.date,
'avail': avail.avail,
'no_ota': avail.no_ota,
})
else:
json_data[room_type.id].append({
'id': False,
'date': cur_date_str,
'avail': room_type.total_rooms_count,
'no_ota': False,
})
json_data[room_type.id].append(
self._generate_avalaibility_data(room_type, cur_date_str, avail))
return json_data
@api.model

View File

@@ -6,16 +6,20 @@ from odoo import models, fields, api
class HotelRoomTypeAvailability(models.Model):
_inherit = 'hotel.room.type.availability'
def _prepare_notif_values(self, record):
return {
'date': record.date,
'avail': record.avail,
'room_type_id': record.room_type_id.id,
'id': record.id,
}
@api.model
def create(self, vals):
res = super(HotelRoomTypeAvailability, self).create(vals)
self.env['bus.hotel.calendar'].send_availability_notification({
'date': res.date,
'avail': res.avail,
'no_ota': res.no_ota,
'room_type_id': res.room_type_id.id,
'id': res.id,
})
self.env['bus.hotel.calendar'].send_availability_notification(
self._prepare_notif_values(res)
)
return res
@api.multi
@@ -23,13 +27,9 @@ class HotelRoomTypeAvailability(models.Model):
ret_vals = super(HotelRoomTypeAvailability, self).write(vals)
bus_hotel_calendar_obj = self.env['bus.hotel.calendar']
for record in self:
bus_hotel_calendar_obj.send_availability_notification({
'date': record.date,
'avail': record.avail,
'no_ota': record.no_ota,
'room_type_id': record.room_type_id.id,
'id': record.id,
})
bus_hotel_calendar_obj.send_availability_notification(
self._prepare_notif_values(record)
)
return ret_vals
@api.multi
@@ -37,13 +37,9 @@ class HotelRoomTypeAvailability(models.Model):
# Construct dictionary with relevant info of removed records
unlink_vals = []
for record in self:
unlink_vals.append({
'date': record.date,
'avail': record.room_type_id.total_rooms_count,
'room_type_id': record.room_type_id.id,
'no_ota': False,
'id': record.id,
})
unlink_vals.append(
self._prepare_notif_values(record)
)
res = super(HotelRoomTypeAvailability, self).unlink()
bus_hotel_calendar_obj = self.env['bus.hotel.calendar']
for uval in unlink_vals:

View File

@@ -80,3 +80,112 @@ class ResUsers(models.Model):
npms_denied_events_tags = fields.Many2many(
'calendar.event.type',
string="Deny Calander Event Tags")
color_pre_reservation = fields.Char('Pre-reservation', default='#A4A4A4')
color_reservation = fields.Char('Confirmed Reservation ', default='#4E9DC4')
color_reservation_pay = fields.Char('Paid Reservation', default='#66CCFF')
color_stay = fields.Char('Checkin', default='#b40606')
color_stay_pay = fields.Char('Paid Checkin', default='#54d12b')
color_checkout = fields.Char('Checkout', default='#FF0000')
color_dontsell = fields.Char('Dont Sell', default='#000000')
color_staff = fields.Char('Staff', default='#FF9933')
color_to_assign = fields.Char('Ota Reservation to Assign', default='#DFFF00')
color_payment_pending = fields.Char('Payment Pending', default='#f70f0f')
color_letter_pre_reservation = fields.Char('Letter Pre-reservation', default='#000000')
color_letter_reservation = fields.Char('Letter Confirmed Reservation ', default='#000000')
color_letter_reservation_pay = fields.Char('Letter Paid Reservation', default='#000000')
color_letter_stay = fields.Char('Letter Checkin', default='#FFFFFF')
color_letter_stay_pay = fields.Char('Letter Stay Pay', default='#000000')
color_letter_checkout = fields.Char('Letter Checkout', default='#FFFFFF')
color_letter_dontsell = fields.Char('Letter Dont Sell', default='#FFFFFF')
color_letter_staff = fields.Char('Letter Staff', default='#000000')
color_letter_to_assign = fields.Char('Letter Ota to Assign', default='#000000')
color_letter_payment_pending = fields.Char('Letter Payment Pending', default='#000000')
def __init__(self, pool, cr):
""" Override of __init__ to add access rights.
Access rights are disabled by default, but allowed on some specific
fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS.
"""
super(ResUsers, self).__init__(pool, cr)
# duplicate list to avoid modifying the original reference
type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
type(self).SELF_WRITEABLE_FIELDS.extend([
'pms_divide_rooms_by_capacity',
'pms_end_day_week',
'pms_end_day_week_offset',
'pms_type_move',
'pms_default_num_days',
'pms_show_notifications',
'pms_show_pricelist',
'pms_show_availability',
'pms_show_num_rooms',
'pms_allowed_events_tags',
'pms_denied_events_tags',
'npms_end_day_week',
'npms_end_day_week_offset',
'npms_default_num_days',
'npms_allowed_events_tags',
'npms_denied_events_tags',
'color_pre_reservation',
'color_reservation',
'color_reservation_pay',
'color_stay',
'color_stay_pay',
'color_checkout',
'color_dontsell',
'color_staff',
'color_to_assign',
'color_payment_pending',
'color_letter_pre_reservation',
'color_letter_reservation',
'color_letter_reservation_pay',
'color_letter_stay',
'color_letter_stay_pay',
'color_letter_checkout',
'color_letter_dontsell',
'color_letter_staff',
'color_letter_to_assign',
'color_letter_payment_pending',
])
# duplicate list to avoid modifying the original reference
type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
type(self).SELF_READABLE_FIELDS.extend([
'pms_divide_rooms_by_capacity',
'pms_end_day_week',
'pms_end_day_week_offset',
'pms_type_move',
'pms_default_num_days',
'pms_show_notifications',
'pms_show_pricelist',
'pms_show_availability',
'pms_show_num_rooms',
'pms_allowed_events_tags',
'pms_denied_events_tags',
'npms_end_day_week',
'npms_end_day_week_offset',
'npms_default_num_days',
'npms_allowed_events_tags',
'npms_denied_events_tags',
'color_pre_reservation',
'color_reservation',
'color_reservation_pay',
'color_stay',
'color_stay_pay',
'color_checkout',
'color_dontsell',
'color_staff',
'color_to_assign',
'color_payment_pending',
'color_letter_pre_reservation',
'color_letter_reservation',
'color_letter_reservation_pay',
'color_letter_stay',
'color_letter_stay_pay',
'color_letter_checkout',
'color_letter_dontsell',
'color_letter_staff',
'color_letter_to_assign',
'color_letter_payment_pending',
])

View File

@@ -1,165 +0,0 @@
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api
class HotelConfiguration(models.TransientModel):
_inherit = 'res.config.settings'
color_pre_reservation = fields.Char('Pre-reservation')
color_reservation = fields.Char('Confirmed Reservation')
color_reservation_pay = fields.Char('Paid Reservation')
color_stay = fields.Char('Checkin')
color_stay_pay = fields.Char('Paid Checkin')
color_checkout = fields.Char('Checkout')
color_dontsell = fields.Char('Dont Sell')
color_staff = fields.Char('Staff')
color_to_assign = fields.Char('Ota Reservation to Assign')
color_payment_pending = fields.Char('Letter Payment Pending')
color_letter_pre_reservation = fields.Char('Letter Pre-reservation')
color_letter_reservation = fields.Char('Letter Confirmed Reservation')
color_letter_reservation_pay = fields.Char('Letter Paid Reservation')
color_letter_stay = fields.Char('Letter Checkin')
color_letter_stay_pay = fields.Char('Letter Stay Pay')
color_letter_checkout = fields.Char('Letter Checkout')
color_letter_dontsell = fields.Char('Letter Dont Sell')
color_letter_staff = fields.Char('Letter Staff')
color_letter_to_assign = fields.Char('Letter Ota to Assign')
color_letter_payment_pending = fields.Char('Letter Payment Pending')
@api.multi
def set_values(self):
super(HotelConfiguration, self).set_values()
self.env['ir.default'].sudo().set(
'res.config.settings',
'color_pre_reservation', self.color_pre_reservation)
self.env['ir.default'].sudo().set(
'res.config.settings',
'color_reservation', self.color_reservation)
self.env['ir.default'].sudo().set(
'res.config.settings',
'color_reservation_pay', self.color_reservation_pay)
self.env['ir.default'].sudo().set(
'res.config.settings', 'color_stay', self.color_stay)
self.env['ir.default'].sudo().set(
'res.config.settings', 'color_stay_pay', self.color_stay_pay)
self.env['ir.default'].sudo().set(
'res.config.settings', 'color_checkout', self.color_checkout)
self.env['ir.default'].sudo().set(
'res.config.settings', 'color_dontsell', self.color_dontsell)
self.env['ir.default'].sudo().set(
'res.config.settings', 'color_staff', self.color_staff)
self.env['ir.default'].sudo().set(
'res.config.settings', 'color_to_assign', self.color_to_assign)
self.env['ir.default'].sudo().set(
'res.config.settings',
'color_payment_pending', self.color_payment_pending)
self.env['ir.default'].sudo().set(
'res.config.settings',
'color_letter_pre_reservation', self.color_letter_pre_reservation)
self.env['ir.default'].sudo().set(
'res.config.settings',
'color_letter_reservation', self.color_letter_reservation)
self.env['ir.default'].sudo().set(
'res.config.settings',
'color_letter_reservation_pay', self.color_letter_reservation_pay)
self.env['ir.default'].sudo().set(
'res.config.settings', 'color_letter_stay', self.color_letter_stay)
self.env['ir.default'].sudo().set(
'res.config.settings', 'color_letter_stay_pay', self.color_letter_stay_pay)
self.env['ir.default'].sudo().set(
'res.config.settings', 'color_letter_checkout', self.color_letter_checkout)
self.env['ir.default'].sudo().set(
'res.config.settings', 'color_letter_dontsell', self.color_letter_dontsell)
self.env['ir.default'].sudo().set(
'res.config.settings', 'color_letter_staff', self.color_letter_staff)
self.env['ir.default'].sudo().set(
'res.config.settings', 'color_letter_to_assign', self.color_letter_to_assign)
self.env['ir.default'].sudo().set(
'res.config.settings',
'color_letter_payment_pending', self.color_letter_payment_pending)
self.env['ir.default'].sudo().set(
'res.config.settings',
'default_arrival_hour', self.default_arrival_hour)
@api.model
def get_values(self):
res = super(HotelConfiguration, self).get_values()
# ONLY FOR v11. DO NOT FORWARD-PORT
color_pre_reservation = self.env['ir.default'].sudo().get(
'res.config.settings',
'color_pre_reservation', self.color_pre_reservation)
color_reservation = self.env['ir.default'].sudo().get(
'res.config.settings',
'color_reservation', self.color_reservation)
color_reservation_pay = self.env['ir.default'].sudo().get(
'res.config.settings',
'color_reservation_pay', self.color_reservation_pay)
color_stay = self.env['ir.default'].sudo().get(
'res.config.settings', 'color_stay', self.color_stay)
color_stay_pay = self.env['ir.default'].sudo().get(
'res.config.settings', 'color_stay_pay', self.color_stay_pay)
color_checkout = self.env['ir.default'].sudo().get(
'res.config.settings', 'color_checkout', self.color_checkout)
color_dontsell = self.env['ir.default'].sudo().get(
'res.config.settings', 'color_dontsell', self.color_dontsell)
color_staff = self.env['ir.default'].sudo().get(
'res.config.settings', 'color_staff', self.color_staff)
color_to_assign = self.env['ir.default'].sudo().get(
'res.config.settings', 'color_to_assign', self.color_to_assign)
color_payment_pending = self.env['ir.default'].sudo().get(
'res.config.settings',
'color_payment_pending', self.color_payment_pending)
color_letter_pre_reservation = self.env['ir.default'].sudo().get(
'res.config.settings',
'color_letter_pre_reservation', self.color_letter_pre_reservation)
color_letter_reservation = self.env['ir.default'].sudo().get(
'res.config.settings',
'color_letter_reservation', self.color_letter_reservation)
color_letter_reservation_pay = self.env['ir.default'].sudo().get(
'res.config.settings',
'color_letter_reservation_pay', self.color_letter_reservation_pay)
color_letter_stay = self.env['ir.default'].sudo().get(
'res.config.settings', 'color_letter_stay', self.color_letter_stay)
color_letter_stay_pay = self.env['ir.default'].sudo().get(
'res.config.settings', 'color_letter_stay_pay',
self.color_letter_stay_pay)
color_letter_checkout = self.env['ir.default'].sudo().get(
'res.config.settings', 'color_letter_checkout',
self.color_letter_checkout)
color_letter_dontsell = self.env['ir.default'].sudo().get(
'res.config.settings', 'color_letter_dontsell',
self.color_letter_dontsell)
color_letter_staff = self.env['ir.default'].sudo().get(
'res.config.settings', 'color_letter_staff',
self.color_letter_staff)
color_letter_to_assign = self.env['ir.default'].sudo().get(
'res.config.settings', 'color_letter_to_assign',
self.color_letter_to_assign)
color_letter_payment_pending = self.env['ir.default'].sudo().get(
'res.config.settings',
'color_letter_payment_pending', self.color_letter_payment_pending)
res.update(
color_pre_reservation=color_pre_reservation,
color_reservation=color_reservation,
color_reservation_pay=color_reservation_pay,
color_stay=color_stay,
color_stay_pay=color_stay_pay,
color_checkout=color_checkout,
color_dontsell=color_dontsell,
color_staff=color_staff,
color_to_assign=color_to_assign,
color_payment_pending=color_payment_pending,
color_letter_pre_reservation=color_letter_pre_reservation,
color_letter_reservation=color_letter_reservation,
color_letter_reservation_pay=color_letter_reservation_pay,
color_letter_stay=color_letter_stay,
color_letter_stay_pay=color_letter_stay_pay,
color_letter_checkout=color_letter_checkout,
color_letter_dontsell=color_letter_dontsell,
color_letter_staff=color_letter_staff,
color_letter_to_assign=color_letter_to_assign,
color_letter_payment_pending=color_letter_payment_pending,
)
return res

View File

@@ -221,8 +221,8 @@ var PMSCalendarController = AbstractController.extend({
_onUpdateButtonsCounter: function (ev) {
var self = this;
var domain_checkouts = [['is_checkout', '=', true]];
var domain_checkins = [['is_checkin', '=', true]];
var domain_checkouts = [['checkout', '=', moment().format(HotelConstants.ODOO_DATETIME_MOMENT_FORMAT)]];
var domain_checkins = [['checkin', '=', moment().format(HotelConstants.ODOO_DATETIME_MOMENT_FORMAT)]];
var domain_overbookings = [['overbooking', '=', true], ['state', 'not in', ['cancelled']]];
$.when(
this.model.search_count(domain_checkouts),

View File

@@ -73,7 +73,7 @@ return AbstractModel.extend({
},
get_amenities: function() {
return this._rpc({
model: 'hotel.room.amenities',
model: 'hotel.amenity',
method: 'search_read',
args: [false, ['id','name']],
context: Session.user_context,

View File

@@ -1 +1,2 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@@ -6,7 +6,7 @@
<field name="res_model">hotel.reservation</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('is_checkin','=', True)]</field>
<field name="domain">[('checkin','=', datetime.datetime.now().strftime('%Y-%m-%d'))]</field>
</record>
<record model="ir.actions.act_window" id="hotel_reservation_action_checkout">
@@ -14,7 +14,7 @@
<field name="res_model">hotel.reservation</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('is_checkout','=', True)]</field>
<field name="domain">[('checkout','=', datetime.datetime.now().strftime('%Y-%m-%d'))]</field>
</record>
<record model="ir.actions.act_window" id="hotel_room_pricelist_cached_action_form_tree">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<odoo>
<record model="ir.ui.view" id="view_hotel_calendar_management_mpms">
<record model="ir.ui.view" id="hotel_calendar_management_view_mpms">
<field name="name">hotel.calendar.management.mpms</field>
<field name="model">hotel.calendar.management</field>
<field name="arch" type="xml">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<odoo>
<record model="ir.ui.view" id="view_hotel_reservation_pms">
<record model="ir.ui.view" id="hotel_reservation_view_pms">
<field name="name">hotel.reservation.pms</field>
<field name="model">hotel.reservation</field>
<field name="arch" type="xml">

View File

@@ -3,7 +3,7 @@
<record id="room_type_view_form" model="ir.ui.view">
<field name="model">hotel.room.type</field>
<field name="inherit_id" ref="hotel.view_hotel_room_type_form" />
<field name="inherit_id" ref="hotel.hotel_room_type_view_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="hcal_sequence" />

View File

@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<odoo>
<record id="room_view_form" model="ir.ui.view">
<record id="hotel_room_view_form" model="ir.ui.view">
<field name="model">hotel.room</field>
<field name="inherit_id" ref="hotel.view_hotel_room_form" />
<field name="inherit_id" ref="hotel.hotel_room_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[hasclass('oe_title')]" position="inside">
<field name="hcal_sequence" />

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_users_form" model="ir.ui.view">
<record id="res_users_view_form" model="ir.ui.view">
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form" />
<field name="arch" type="xml">
@@ -36,6 +36,40 @@
<field name="npms_denied_events_tags" widget="many2many_tags" />
</group>
</group>
<group string="Reservation States Colours" name="reservation_colors" colspan="8">
<group>
<group colspan="4">
<field name="color_pre_reservation" widget="color" />
<field name="color_reservation" widget="color" />
<field name="color_reservation_pay" widget="color" />
<field name="color_stay" widget="color" />
<field name="color_stay_pay" widget="color" />
</group>
<group colspan="4">
<field name="color_checkout" widget="color" />
<field name="color_dontsell" widget="color" />
<field name="color_staff" widget="color" />
<field name="color_to_assign" widget="color" />
<field name="color_payment_pending" widget="color" />
</group>
</group>
<group>
<group colspan="4">
<field name="color_letter_pre_reservation" widget="color" />
<field name="color_letter_reservation" widget="color" />
<field name="color_letter_reservation_pay" widget="color" />
<field name="color_letter_stay" widget="color" />
<field name="color_letter_stay_pay" widget="color" />
</group>
<group colspan="4">
<field name="color_letter_checkout" widget="color" />
<field name="color_letter_dontsell" widget="color" />
<field name="color_letter_staff" widget="color" />
<field name="color_letter_to_assign" widget="color" />
<field name="color_letter_payment_pending" widget="color" />
</group>
</group>
</group>
</xpath>
</field>
</record>

View File

@@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Calendar Settings -->
<record id="view_hotel_config_settings" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.hotel</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="80"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@data-key='hotel']" position="inside">
<h2>Calendar colors</h2>
<div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box">
<field name="color_pre_reservation" required="True" widget="color"/><field name="color_letter_pre_reservation" required="True" widget="color" />
<field name="color_reservation" required="True" widget="color"/><field name="color_letter_reservation" required="True" widget="color" />
<field name="color_reservation_pay" required="True" widget="color"/><field name="color_letter_reservation_pay" required="True" widget="color" />
<field name="color_stay" required="True" widget="color"/><field name="color_letter_stay" required="True" widget="color" />
<field name="color_stay_pay" required="True" widget="color"/><field name="color_letter_stay_pay" required="True" widget="color" />
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<field name="color_checkout" required="True" widget="color"/><field name="color_letter_checkout" required="True" widget="color" />
<field name="color_dontsell" required="True" widget="color"/><field name="color_letter_dontsell" required="True" widget="color" />
<field name="color_staff" required="True" widget="color"/><field name="color_letter_staff" required="True" widget="color" />
<field name="color_to_assign" required="True" widget="color"/><field name="color_letter_to_assign" required="True" widget="color" />
<field name="color_payment_pending" required="True" widget="color"/><field name="color_letter_payment_pending" required="True" widget="color" />
</div>
</div>
</xpath>
</field>
</record>
</odoo>

View File

@@ -2,7 +2,7 @@
<odoo>
<!-- Form view of hotel room -->
<record model="ir.ui.view" id="view_hotel_room_pricelist_cached_form">
<record model="ir.ui.view" id="hotel_room_pricelist_cached_view_form">
<field name="name">hotel.room.pricelist.cached.form</field>
<field name="model">room.pricelist.cached</field>
<field name="arch" type="xml">
@@ -19,7 +19,7 @@
</record>
<!-- Tree view of hotel room -->
<record model="ir.ui.view" id="view_hotel_room_pricelist_cached_tree">
<record model="ir.ui.view" id="hotel_room_pricelist_cached_view_tree">
<field name="name">hotel.room.pricelist.cached.tree</field>
<field name="model">room.pricelist.cached</field>
<field name="arch" type="xml">

View File

@@ -21,16 +21,16 @@
##############################################################################
{
'name': 'Hotel Calendar WuBook',
'name': 'Hotel Calendar Channel Connector',
'version': '1.0',
'author': "Alexandre Díaz (Aloxa Solucións S.L.) <alex@aloxa.eu>",
'website': 'https://www.eiqui.com',
'author': "Alexandre Díaz <dev@redneboa.es>",
'website': 'https://github.com/hootel/hootel',
'category': 'eiqui/hotel',
'summary': "Hotel Calendar",
'description': "Hotel Calendar WuBook",
'summary': "Hotel Calendar Channel Connector",
'description': "Unify 'hotel_calendar' and 'hotel_channel_connector'",
'depends': [
'hotel_calendar',
'hotel_wubook_proto',
'hotel_channel_connector',
],
'external_dependencies': {
'python': []

View File

@@ -1,8 +1,8 @@
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from datetime import datetime
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
from openerp import models, api
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
from odoo import models, api
from odoo.addons.hotel_calendar.controllers.bus import HOTEL_BUS_CHANNEL_ID
@@ -30,15 +30,21 @@ class BusHotelCalendar(models.TransientModel):
def _generate_reservation_notif(self, vals):
json = super(BusHotelCalendar, self)._generate_reservation_notif(vals)
json['reservation'].update({
'wrid': vals['wrid'],
'external_id': vals['external_id'],
})
return json
@api.model
def send_issue_notification(self, ntype, title, issue_id, section,
message):
notif = self._generate_issue_notification(ntype, title, issue_id,
section, message)
def _generate_availability_notification(self, vals):
date_dt = datetime.strptime(vals['date'], DEFAULT_SERVER_DATE_FORMAT)
json = super(BusHotelCalendar, self)._generate_availability_notification(vals)
json['availability'][vals['room_type_id']][date_dt.strftime("%d/%m/%Y")].append(
vals['no_ota'])
return json
@api.model
def send_issue_notification(self, ntype, title, issue_id, section, message):
notif = self._generate_issue_notification(ntype, title, issue_id, section, message)
self.env['bus.bus'].sendone(
(self._cr.dbname, 'hotel.reservation',
HOTEL_BUS_CHANNEL_ID), notif)
(self._cr.dbname, 'hotel.reservation',
HOTEL_BUS_CHANNEL_ID), notif)

View File

@@ -1,6 +1,6 @@
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, api
from odoo import models, api
class HotelCalendarManagement(models.TransientModel):
@@ -10,7 +10,19 @@ class HotelCalendarManagement(models.TransientModel):
def _get_availability_values(self, avail, room_type):
vals = super(HotelCalendarManagement, self)._get_availability_values(
avail, room_type)
vals.update({'wmax_avail': vals['avail']})
vals.update({
'channel_max_avail': vals['avail'],
'no_ota': avail['no_ota'],
})
return vals
@api.model
def _generate_avalaibility_data(self, room_type, date, avail):
vals = super(HotelCalendarManagement, self)._generate_avalaibility_data(
room_type, date, avail)
vals.update({
'no_ota': avail and avail.no_ota or False,
})
return vals
@api.multi

View File

@@ -1,14 +1,14 @@
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api, _
from odoo import models, fields, api, _
class WuBookIssue(models.Model):
class HotelChannelConnectorIssue(models.Model):
_inherit = 'hotel.channel.connector.issue'
@api.model
def create(self, vals):
issue_id = super(WuBookIssue, self).create(vals)
issue_id = super(HotelChannelConnectorIssue, self).create(vals)
self.env['bus.hotel.calendar'].send_issue_notification(
'warn',
_("Oops! Issue Reported!!"),

View File

@@ -2,8 +2,8 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
from datetime import datetime, timedelta
from openerp import models, fields, api, _
from openerp.tools import (
from odoo import models, fields, api, _
from odoo.tools import (
DEFAULT_SERVER_DATE_FORMAT,
DEFAULT_SERVER_DATETIME_FORMAT)
_logger = logging.getLogger(__name__)
@@ -27,15 +27,17 @@ class HotelReservation(models.Model):
room_name, partner_phone, state, fix_days)
reserv = self.env['hotel.reservation'].browse(vals['reserv_id'])
vals['reservation'].update({
'fix_days': (reserv.wrid and reserv.wrid != '') or fix_days,
'wchannel': (reserv.wchannel_id and reserv.wchannel_id.name),
'fix_days': (any(reserv.channel_bind_ids) and
reserv.channel_bind_ids[0].external_id) or fix_days,
'ota_id': (any(reserv.channel_bind_ids) and
reserv.channel_bind_ids[0].ota_id and
reserv.channel_bind_ids[0].ota_id.name),
})
return vals
@api.multi
def _hcalendar_reservation_data(self, reservations):
vals = super(HotelReservation, self)._hcalendar_reservation_data(
reservations)
vals = super(HotelReservation, self)._hcalendar_reservation_data(reservations)
hotel_reservation_obj = self.env['hotel.reservation']
json_reservations = []
for v_rval in vals[0]:
@@ -56,12 +58,16 @@ class HotelReservation(models.Model):
# Read-Only
False,
# Fix Days
(reserv.wrid and reserv.wrid != '') or reserv.splitted,
(any(reserv.channel_bind_ids) and
reserv.channel_bind_ids[0].external_id) or reserv.splitted,
# Fix Rooms
False,
reserv.overbooking))
# Update tooltips
vals[1][reserv.id].append(reserv.wchannel_id.name)
if any(reserv.channel_bind_ids):
vals[1][reserv.id].append(reserv.channel_bind_ids[0].ota_id.name)
else:
vals[1][reserv.id].append(False)
return (json_reservations, vals[1])
@api.multi
@@ -92,7 +98,8 @@ class HotelReservation(models.Model):
'fix_days': record.splitted or record.is_from_ota,
'overbooking': record.overbooking,
'price': record.folio_id.amount_total,
'wrid': record.wrid,
'external_id': (any(record.channel_bind_ids) and
record.channel_bind_ids[0].external_id),
})
@api.multi

View File

@@ -1,37 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2017 Solucións Aloxa S.L. <info@aloxa.eu>
# Alexandre Díaz <dev@redneboa.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields, api, _
class WuBookIssue(models.Model):
_inherit = 'wubook.issue'
@api.model
def create(self, vals):
issue_id = super(WuBookIssue, self).create(vals)
self.env['bus.hotel.calendar'].send_issue_notification(
'warn',
_("Oops! Issue Reported!!"),
issue_id.id,
issue_id.section,
issue_id.message)
return issue_id

View File

@@ -1,3 +1,3 @@
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import test_folio
#from . import test_folio

View File

@@ -3,7 +3,7 @@
<data>
<!-- Tree view of hotel reservation -->
<record model="ir.ui.view" id="view_hotel_toassign_reservation_tree">
<record model="ir.ui.view" id="hotel_toassign_reservation_view_tree">
<field name="name">hotel.toassign.reservation.tree</field>
<field name="model">hotel.reservation</field>
<field name="arch" type="xml">
@@ -68,7 +68,7 @@
<record id="hotel_reservation_view_form" model="ir.ui.view">
<field name="model">hotel.reservation</field>
<field name="inherit_id" ref="hotel.view_hotel_reservation_form" />
<field name="inherit_id" ref="hotel.hotel_reservation_view_form" />
<field name="arch" type="xml">
<xpath expr="//button[@name='unify']" position="after">
<button name="mark_as_readed" string="Mark as Read"

View File

@@ -5,7 +5,7 @@
'name': 'Hotel Channel Connector',
'version': '1.0',
'author': "Alexandre Díaz <dev@redneboa.es>",
'website': 'https://www.eiqui.com',
'website': 'https://github.com/hootel/hootel',
'category': 'hotel/connector',
'summary': "Hotel Channel Connector Base",
'description': "Hotel Channel Connector Base",
@@ -18,9 +18,6 @@
},
'data': [
'data/cron_jobs.xml',
'wizard/wubook_import_plan_prices.xml',
'wizard/wubook_import_plan_restrictions.xml',
'wizard/wubook_import_availability.xml',
'views/general.xml',
'views/hotel_channel_connector_issue_views.xml',
'views/inherited_hotel_reservation_views.xml',
@@ -41,6 +38,7 @@
'views/channel_product_pricelist_views.xml',
'views/channel_product_pricelist_item_views.xml',
'views/channel_connector_backend_views.xml',
'wizard/inherited_massive_changes.xml',
'data/menus.xml',
'data/sequences.xml',
#'security/ir.model.access.csv',

View File

@@ -178,7 +178,8 @@ class HotelReservation(models.Model):
def unlink(self):
vals = []
for record in self:
if record.wrid and not record.parent_reservation:
if any(record.channel_bind_ids) and record.channel_bind_ids[0].external_id \
and not record.parent_reservation:
raise UserError(_("You can't delete OTA's reservations"))
vals.append({
'checkin': record.checkin,

View File

@@ -28,8 +28,6 @@ class ChannelHotelRoomTypeAvailability(models.Model):
string='Pricelist',
required=True,
ondelete='cascade')
no_ota = fields.Boolean('No OTA', default=False)
booked = fields.Boolean('Booked', default=False, readonly=True)
channel_max_avail = fields.Integer("Max. Channel Avail",
default=_default_channel_max_avail,
old_name='wmax_avail')
@@ -37,7 +35,7 @@ class ChannelHotelRoomTypeAvailability(models.Model):
old_name='wpushed')
@api.constrains('channel_max_avail')
def _check_wmax_avail(self):
def _check_channel_max_avail(self):
for record in self:
if record.channel_max_avail > record.odoo_id.room_type_id.total_rooms_count:
raise ValidationError(_("max avail for channel can't be high \
@@ -95,6 +93,16 @@ class HotelRoomTypeAvailability(models.Model):
inverse_name='odoo_id',
string='Hotel Room Type Availability Connector Bindings')
no_ota = fields.Boolean('No OTA', default=False)
booked = fields.Boolean('Booked', default=False, readonly=True)
def _prepare_notif_values(self, record):
vals = super(HotelRoomTypeAvailability, self)._prepare_notif_values()
vals.update({
'no_ota': record.no_ota,
})
return vals
@api.constrains('avail')
def _check_avail(self):
room_type_obj = self.env['hotel.room.type']

View File

@@ -1,22 +1,2 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2017 Solucións Aloxa S.L. <info@aloxa.eu>
# Alexandre Díaz <dev@redneboa.es>
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_channel_backend_form" model="ir.ui.view">
<record id="channel_backend_view_form" model="ir.ui.view">
<field name="name">channel.backend.form</field>
<field name="model">channel.backend</field>
<field name="arch" type="xml">
@@ -181,7 +181,7 @@
</field>
</record>
<record id="view_channel_backend_tree" model="ir.ui.view">
<record id="channel_backend_view_tree" model="ir.ui.view">
<field name="name">channel.backend.tree</field>
<field name="model">channel.backend</field>
<field name="arch" type="xml">
@@ -197,7 +197,7 @@
<field name="res_model">channel.backend</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_channel_backend_tree"/>
<field name="view_id" ref="channel_backend_view_tree"/>
</record>
</odoo>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_channel_hotel_reservation_form" model="ir.ui.view">
<record id="channel_hotel_reservation_view_form" model="ir.ui.view">
<field name="name">channel.hotel.reservation.form</field>
<field name="model">channel.hotel.reservation</field>
<field name="arch" type="xml">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_channel_hotel_room_type_availability_form" model="ir.ui.view">
<record id="channel_hotel_room_type_availability_view_form" model="ir.ui.view">
<field name="name">channel.hotel.room.type.availability.form</field>
<field name="model">channel.hotel.room.type.availability</field>
<field name="arch" type="xml">
@@ -10,6 +10,10 @@
<field name="id" invisible="1" />
<field name="backend_id" attrs="{'visible': [('id','=', False)]}" />
</group>
<group>
<field name="no_ota" />
<field name="booked" />
</group>
<group>
<field name="channel_max_avail" />
<field name="channel_pushed" />
@@ -18,7 +22,7 @@
</field>
</record>
<record id="view_channel_hotel_room_type_availability_tree" model="ir.ui.view">
<record id="channel_hotel_room_type_availability_view_tree" model="ir.ui.view">
<field name="name">channel.hotel.room.type.availability.tree</field>
<field name="model">channel.hotel.room.type.availability</field>
<field name="arch" type="xml">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_channel_hotel_room_type_restriction_item_form" model="ir.ui.view">
<record id="channel_hotel_room_type_restriction_item_view_form" model="ir.ui.view">
<field name="name">channel.hotel.room.type.restriction.item.form</field>
<field name="model">channel.hotel.room.type.restriction.item</field>
<field name="arch" type="xml">
@@ -17,7 +17,7 @@
</field>
</record>
<record id="view_channel_hotel_room_type_restriction_item_tree" model="ir.ui.view">
<record id="channel_hotel_room_type_restriction_item_view_tree" model="ir.ui.view">
<field name="name">channel.hotel.room.type.restriction.item.tree</field>
<field name="model">channel.hotel.room.type.restriction.item</field>
<field name="arch" type="xml">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_channel_hotel_room_type_restriction_form" model="ir.ui.view">
<record id="channel_hotel_room_type_restriction_view_form" model="ir.ui.view">
<field name="name">channel.hotel.room.type.restriction.form</field>
<field name="model">channel.hotel.room.type.restriction</field>
<field name="arch" type="xml">
@@ -17,7 +17,7 @@
</field>
</record>
<record id="view_channel_hotel_room_type_restriction_tree" model="ir.ui.view">
<record id="channel_hotel_room_type_restriction_view_tree" model="ir.ui.view">
<field name="name">channel.hotel.room.type.restriction.tree</field>
<field name="model">channel.hotel.room.type.restriction</field>
<field name="arch" type="xml">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_channel_hotel_room_type_form" model="ir.ui.view">
<record id="channel_hotel_room_type_view_form" model="ir.ui.view">
<field name="name">channel.hotel.room.type.form</field>
<field name="model">channel.hotel.room.type</field>
<field name="arch" type="xml">
@@ -19,7 +19,7 @@
</field>
</record>
<record id="view_channel_hotel_room_type_tree" model="ir.ui.view">
<record id="channel_hotel_room_type_view_tree" model="ir.ui.view">
<field name="name">channel.hotel.room.type.tree</field>
<field name="model">channel.hotel.room.type</field>
<field name="arch" type="xml">

View File

@@ -2,7 +2,7 @@
<odoo>
<!-- Form view -->
<record model="ir.ui.view" id="view_hotel_channel_connector_ota_info_form">
<record model="ir.ui.view" id="hotel_channel_connector_ota_info_view_form">
<field name="name">channel.ota.info.form</field>
<field name="model">channel.ota.info</field>
<field name="arch" type="xml">
@@ -23,7 +23,7 @@
</record>
<!-- Tree view -->
<record model="ir.ui.view" id="view_hotel_channel_connector_ota_info_tree">
<record model="ir.ui.view" id="hotel_channel_connector_ota_info_view_tree">
<field name="name">channel.ota.info.tree</field>
<field name="model">channel.ota.info</field>
<field name="arch" type="xml">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_channel_product_pricelist_item_form" model="ir.ui.view">
<record id="channel_product_pricelist_item_view_form" model="ir.ui.view">
<field name="name">channel.product.pricelist.item.form</field>
<field name="model">channel.product.pricelist.item</field>
<field name="arch" type="xml">
@@ -14,7 +14,7 @@
</field>
</record>
<record id="view_channel_hotel_product_pricelist_item_tree" model="ir.ui.view">
<record id="channel_hotel_product_pricelist_item_view_tree" model="ir.ui.view">
<field name="name">channel.hotel.product.pricelist.item.tree</field>
<field name="model">channel.product.pricelist.item</field>
<field name="arch" type="xml">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_channel_product_pricelist_form" model="ir.ui.view">
<record id="channel_product_pricelist_view_form" model="ir.ui.view">
<field name="name">channel.product.pricelist.form</field>
<field name="model">channel.product.pricelist</field>
<field name="arch" type="xml">
@@ -18,7 +18,7 @@
</field>
</record>
<record id="view_channel_product_pricelist_tree" model="ir.ui.view">
<record id="channel_product_pricelist_view_tree" model="ir.ui.view">
<field name="name">channel.hotel.product.pricelist.tree</field>
<field name="model">channel.product.pricelist</field>
<field name="arch" type="xml">

View File

@@ -3,19 +3,12 @@
<record id="hotel_folio_view_form" model="ir.ui.view">
<field name="model">hotel.folio</field>
<field name="inherit_id" ref="hotel.view_hotel_folio1_form" />
<field name="inherit_id" ref="hotel.hotel_folio_view_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_internal_comment']" position="before">
<field name="has_channel_reservations" invisible="True" />
<field name="customer_notes" readonly="True" attrs="{'invisible':[('has_channel_reservations', '=', False)]}"/>
</xpath>
</field>
</record>
<record id="view_hotel_folio1_form" model="ir.ui.view">
<field name="model">hotel.folio</field>
<field name="inherit_id" ref="hotel.view_hotel_folio1_form" />
<field name="arch" type="xml">
<xpath expr="//notebook/page/field[@name='room_lines']/tree/field[@name='checkout']" position="after">
<field name="origin_sale"/>
<field name="is_from_ota" invisible="1"/>

View File

@@ -3,7 +3,7 @@
<record id="hotel_reservation_view_form" model="ir.ui.view">
<field name="model">hotel.reservation</field>
<field name="inherit_id" ref="hotel.view_hotel_reservation_form" />
<field name="inherit_id" ref="hotel.hotel_reservation_view_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='channel_type']" position="after">
<!-- field name="channel_reservation_id" attrs='{"readonly": [("able_to_modify_channel","=",False)], "invisible":[("channel_type","!=", "web")]}' string="OTA"/-->
@@ -61,7 +61,7 @@
<!-- Tree view of hotel reservation -->
<record model="ir.ui.view" id="view_hotel_reservation_tree">
<field name="model">hotel.reservation</field>
<field name="inherit_id" ref="hotel.view_hotel_reservation_tree" />
<field name="inherit_id" ref="hotel.hotel_reservation_view_tree" />
<field name="arch" type="xml">
<xpath expr="//field[@name='checkout']" position="after">
<field name="origin_sale"/>
@@ -70,9 +70,9 @@
</record>
<!-- Search view of hotel reservation -->
<record model="ir.ui.view" id="view_hotel_reservation_search">
<record model="ir.ui.view" id="hotel_reservation_view_search">
<field name="model">hotel.reservation</field>
<field name="inherit_id" ref="hotel.view_hotel_reservation_search" />
<field name="inherit_id" ref="hotel.hotel_reservation_view_search" />
<field name="arch" type="xml">
<xpath expr="//field[@name='folio_id']" position="after">
<!-- field name="wchannel_reservation_code"/-->
@@ -85,7 +85,7 @@
</record>
<!--graph view of hotel reservation -->
<record id="view_hotel_reservation_graph" model="ir.ui.view">
<record id="hotel_reservation_view_graph" model="ir.ui.view">
<field name="name">view.hotel.reservation.graph</field>
<field name="model">hotel.reservation</field>
<field name="arch" type="xml">
@@ -97,7 +97,7 @@
</record>
<!--pivot view of hotel reservation -->
<record id="view_hotel_pivot_graph" model="ir.ui.view">
<record id="hotel_reservation_view_pivot_graph" model="ir.ui.view">
<field name="name">view.hotel.pivot.graph</field>
<field name="model">hotel.reservation</field>
<field name="arch" type="xml">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<odoo>
<record id="room_type_restriction_item_view" model="ir.ui.view">
<record id="room_type_restriction_item_view_from" model="ir.ui.view">
<field name="model">hotel.room.type.restriction.item</field>
<field name="inherit_id" ref="hotel.room_type_restriction_item_view_form" />
<field name="arch" type="xml">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<odoo>
<record id="room_type_restriction_view" model="ir.ui.view">
<record id="room_type_restriction_view_form" model="ir.ui.view">
<field name="model">hotel.room.type.restriction</field>
<field name="inherit_id" ref="hotel.room_type_restriction_view_form" />
<field name="arch" type="xml">

View File

@@ -3,7 +3,7 @@
<record id="room_type_view_form" model="ir.ui.view">
<field name="model">hotel.room.type</field>
<field name="inherit_id" ref="hotel.view_hotel_room_type_form" />
<field name="inherit_id" ref="hotel.hotel_room_type_view_form" />
<field name="arch" type="xml">
<xpath expr="//sheet" position="inside">
<notebook>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<odoo>
<record id="product_pricelist_view" model="ir.ui.view">
<record id="product_pricelist_view_form" model="ir.ui.view">
<field name="model">product.pricelist</field>
<field name="inherit_id" ref="product.product_pricelist_view" />
<field name="arch" type="xml">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_partner_form" model="ir.ui.view">
<record id="res_partner_view_form" model="ir.ui.view">
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">

View File

@@ -1,27 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2017 Solucións Aloxa S.L. <info@aloxa.eu>
# Alexandre Díaz <dev@redneboa.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import wubook_import_plan_prices
from . import wubook_import_plan_restrictions
from . import wubook_import_availability
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import inherited_massive_changes
from . import inherited_duplicate_reservation
from . import inherited_massive_price_reservation_days

View File

@@ -1,26 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2017 Solucións Aloxa S.L. <info@aloxa.eu>
# Alexandre Díaz <dev@redneboa.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.exceptions import ValidationError
from openerp import models, api, _
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.exceptions import ValidationError
from odoo import models, api, _
class MassiveChangesWizard(models.TransientModel):

View File

@@ -1,38 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2017 Solucións Aloxa S.L. <info@aloxa.eu>
# Alexandre Díaz <dev@redneboa.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from datetime import datetime, timedelta
from openerp.exceptions import ValidationError
from openerp import models, api
from odoo.exceptions import ValidationError
from odoo import fields, models, api
class MassiveChangesWizard(models.TransientModel):
_inherit = 'hotel.wizard.massive.changes'
change_no_ota = fields.Boolean(default=False)
no_ota = fields.Boolean('No OTA', default=False)
@api.model
def _get_availability_values(self, ndate, room_type, record):
vals = super(MassiveChangesWizard, self)._get_availability_values(
ndate, room_type, record)
vals.update({
'wmax_avail': vals['avail']
'channel_max_avail': vals['avail'],
'no_ota': record.no_ota,
})
return vals

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" ?>
<odoo>
<record model="ir.ui.view" id="hotel_massive_changes_wizard_view_form">
<field name="model">hotel.wizard.massive.changes</field>
<field name="inherit_id" ref="hotel.view_hotel_massive_changes_wizard" />
<field name="arch" type="xml">
<xpath expr="//table[hasclass('oe_form_group')][1]/tbody" position="inside">
<tr class="oe_form_group_row">
<td class="oe_form_group_cell oe_form_group_cell_label"><field name="change_no_ota" /> <strong> No OTA</strong></td>
<td class="oe_form_group_cell"><field name="no_ota" attrs="{'readonly':[('change_no_ota', '=', False)]}" /></td>
</tr>
</xpath>
</field>
</record>
</odoo>

View File

@@ -1,25 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2018 Alexandre Díaz <dev@redneboa.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.exceptions import ValidationError
from openerp import models, api, _
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.exceptions import ValidationError
from odoo import models, api, _
class MassivePriceChangeWizard(models.TransientModel):

View File

@@ -1,43 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2017 Solucións Aloxa S.L. <info@aloxa.eu>
# Alexandre Díaz <dev@redneboa.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.exceptions import ValidationError
from openerp import models, fields, api, _
from ..components.backend_adapter import DEFAULT_WUBOOK_DATE_FORMAT
class ImportAvailabilityWizard(models.TransientModel):
_name = 'wubook.wizard.availability'
date_start = fields.Datetime('Start Date', required=True)
date_end = fields.Datetime('End Date', required=True)
set_max_avail = fields.Boolean('Set max avail?', default=True)
@api.multi
def import_availability(self):
for record in self:
wres = self.env['wubook'].fetch_rooms_values(
record.date_start,
record.date_end,
set_max_avail=record.set_max_avail)
if not wres:
raise ValidationError(_("Can't fetch availability from WuBook"))
return True

View File

@@ -1,40 +0,0 @@
<?xml version="1.0" ?>
<odoo>
<record model="ir.ui.view" id="view_wubook_import_availability_wizard">
<field name="name">wubook.wizard.availability</field>
<field name="model">wubook.wizard.availability</field>
<field name="arch" type="xml">
<form string="Import WuBook Availability" >
<group>
<group>
<field name="date_start" required="1" />
</group>
<group>
<field name="date_end" required="1" />
</group>
</group>
<group>
<field name="set_max_avail" />
</group>
<footer>
<button name="import_availability" string="Import" type="object"
class="oe_highlight" />
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="action_wubook_import_availability" model="ir.actions.act_window">
<field name="name">Import Availability</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">wubook.wizard.availability</field>
<field name="view_id" ref="view_wubook_import_availability_wizard"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</odoo>

View File

@@ -1,48 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2017 Solucións Aloxa S.L. <info@aloxa.eu>
# Alexandre Díaz <dev@redneboa.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.exceptions import ValidationError
from openerp import models, fields, api, _
from ..components.backend_adapter import DEFAULT_WUBOOK_DATE_FORMAT
class ImportPlanPricesWizard(models.TransientModel):
_name = 'wubook.wizard.plan.prices'
date_start = fields.Datetime('Start Date', required=True)
date_end = fields.Datetime('End Date', required=True)
@api.multi
def import_plan_prices(self):
pricelist_id = self.env['product.pricelist'].browse(
self.env.context.get('active_id'))
if pricelist_id:
for record in self:
date_start_dt = fields.Date.from_string(record.date_start)
date_end_dt = fields.Date.from_string(record.date_end)
wres = self.env['wubook'].fetch_plan_prices(
pricelist_id.wpid,
date_start_dt.strftime(DEFAULT_WUBOOK_DATE_FORMAT),
date_end_dt.strftime(DEFAULT_WUBOOK_DATE_FORMAT))
if not wres:
raise ValidationError(_("Can't fetch plan prices \
from WuBook"))
return True

View File

@@ -1,37 +0,0 @@
<?xml version="1.0" ?>
<odoo>
<record model="ir.ui.view" id="view_wubook_import_plan_prics_wizard">
<field name="name">wubook.wizard.plan.prices</field>
<field name="model">wubook.wizard.plan.prices</field>
<field name="arch" type="xml">
<form string="Import WuBook Plan Prices" >
<group>
<group>
<field name="date_start" required="1" />
</group>
<group>
<field name="date_end" required="1" />
</group>
</group>
<footer>
<button name="import_plan_prices" string="Import" type="object"
class="oe_highlight" />
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="action_wubook_import_plan_prices" model="ir.actions.act_window">
<field name="name">Import Plan Prices</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">wubook.wizard.plan.prices</field>
<field name="view_id" ref="view_wubook_import_plan_prics_wizard"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</odoo>

View File

@@ -1,53 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2017 Solucións Aloxa S.L. <info@aloxa.eu>
# Alexandre Díaz <dev@redneboa.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.exceptions import ValidationError
from openerp import models, fields, api, _
from ..components.backend_adapter import DEFAULT_WUBOOK_DATE_FORMAT
class ImportPlanRestrictionsWizard(models.TransientModel):
_name = 'wubook.wizard.plan.restrictions'
date_start = fields.Datetime('Start Date', required=True)
date_end = fields.Datetime('End Date', required=True)
@api.multi
def import_plan_restrictions(self):
restriction_id = self.env['hotel.room.type.restriction'].browse(
self.env.context.get('active_id'))
if restriction_id:
for record in self:
date_start_dt = fields.Date.from_string(record.date_start)
date_end_dt = fields.Date.from_string(record.date_end)
if int(restriction_id.wpid) == 0:
wres = self.env['wubook'].fetch_rooms_values(
date_start_dt.strftime(DEFAULT_WUBOOK_DATE_FORMAT),
date_end_dt.strftime(DEFAULT_WUBOOK_DATE_FORMAT))
else:
wres = self.env['wubook'].fetch_rplan_restrictions(
date_start_dt.strftime(DEFAULT_WUBOOK_DATE_FORMAT),
date_end_dt.strftime(DEFAULT_WUBOOK_DATE_FORMAT),
restriction_id.wpid)
if not wres:
raise ValidationError(_("Can't fetch restrictions \
from WuBook"))
return True

View File

@@ -1,38 +0,0 @@
<?xml version="1.0" ?>
<odoo>
<record model="ir.ui.view" id="view_wubook_import_plan_restrictions_wizard">
<field name="name">wubook.wizard.plan.prices</field>
<field name="model">wubook.wizard.plan.prices</field>
<field name="arch" type="xml">
<form string="Import WuBook Plan Restrictions" >
<group>
<group>
<field name="date_start" required="1" />
</group>
<group>
<field name="date_end" required="1" />
</group>
</group>
<footer>
<button name="import_plan_restrictions" string="Import" type="object"
class="oe_highlight" />
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="action_wubook_import_plan_restrictions" model="ir.actions.act_window">
<field name="name">Import Plan Restrictions</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">wubook.wizard.plan.restrictions</field>
<field name="view_id" ref="view_wubook_import_plan_restrictions_wizard"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="context">{'restriction_id': [active_id]}</field>
</record>
</odoo>