Wizard with calendar view


I managed to popup a calendar wizard on a form after pressing a button.
However the wizard cant close after it is popup.
I keep clicking the Close button but it is not working then I pressed F12 on chrome and saw this error.

Uncaught TypeError: Cannot read property ‘validate’ of null

May I know if anyone solved this error before? Thank you

Below are part of my code:

class RoomBooking(Workflow, metaclass=PoolMeta):
    __name__ = 'room.booking'

    def view_schedule_btn(cls, bookings):

class ViewSchedule(Wizard):
    'View Schedule Wizard'
    __name__ = 'room.schedule.view'

    start = StateView(
        'room_booking.room_calendar', [
            Button('Close', 'end', 'tryton-cancel'),


<record model="ir.ui.view" id="room_booking.room_calendar">
      <field name="model">room.booking</field>
      <field name="type">calendar</field>
      <field name="name">room_calendar_view</field>

Normally only form views are allowed in wizard.
But the error is strange, it will help to understand if you were not running the minified version of sao.

Thank you, managed to solve this after debug in non-minified version of sao.

// added below code to bypass the validate when the view is calendar
            if (this.screen.current_view.view_type === 'calendar') {
                this.state = state;
//end bypass
            //error occurred at below line 
            return this.screen.current_record.validate().then(function(validate) {

May I suggest you to provide the as a patch at bugs.tryton.org. This will help improving the code and avoid others are running into the same trouble.

That’s why wizard can only work with form view because it requires a current record.
Indeed you should use a Model that contains a One2Many field which is displayed using a calendar view.

Maybe we could have a generic test that ensure that the view of StateView is only of type form: Issue 10143: Test wizard StateView uses a form view - Tryton issue tracker