AttributeError: object has no attribute
<p>In my custom Odoo module, i have to call a python function on a button click. I followed the exact way as in the documentations. But i got error as follows..
<code>AttributeError: 'book.meeting' object has no attribute 'checkout_function'</code></p>

<p>My code is as follows..</p>

<pre><code>class BookMRoom(models.Model):
 _name="book.meeting"



 name=fields.Char(string="Enter booking person name",required=True)
 company_name=fields.Many2one('res.company','Enter your company name',required=True)
 start_time=fields.Datetime(string="Starting date",select=True,required=True)
 end_time=fields.Datetime(string="Ending date",select=True)
 meeting_room=fields.Many2one('mroom', 'select the room',required=True)
 room_info=fields.Many2one(comodel_name='mroom', field='description')
 amenities=fields.Many2one('mroom','Select amenities')
 ob =fields.Many2one('mroom')

 @api.multi
 def checkout_function(self,cr,uid,ids,context=None):
    #raise Exception('Coming Inside Checkout Function')
    current_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
    self.end_time=current_time
    meeting_obj=self.env['mroom']
    meeting_room.status='available'
    return meeting_room.status
</code></pre>

<p>My XML file..</p>

<pre><code>&lt;record model="ir.ui.view" id="book-form"&gt;
   &lt;field name="name"&gt;book.meeting.form&lt;/field&gt;
   &lt;field name="model"&gt;book.meeting&lt;/field&gt;
   &lt;field name="type"&gt;form&lt;/field&gt;
   &lt;field name="arch" type="xml"&gt;
 &lt;form string="booking_view_form"&gt;
        &lt;sheet string="Book meeting room"&gt;
          &lt;label for="name" string="Booking person name"/&gt;      
          &lt;h1&gt;
             &lt;field name="name" placeholder="Booking person" class="oe_inline" string="Booking person"/&gt;
          &lt;/h1&gt;
          &lt;group&gt;
             &lt;group&gt;
                 &lt;field name="company_name" string="Company name"/&gt;

                 &lt;field name="meeting_room" string="select a room" options="{'no_quick_create':True,'no_create_edit':True}"/&gt;
             &lt;/group&gt;
             &lt;group&gt;
         &lt;field name="start_time" string="Booked date"/&gt;
         &lt;field name="end_time" string="Ending date" help="Give check out time after the usage of room" disable="True"/&gt;
         &lt;button string="Check Out" name='checkout_function' type="object"/&gt;
             &lt;/group&gt;
          &lt;/group&gt;
        &lt;notebook&gt;
           &lt;page string="Room description"&gt;
               &lt;field name="room_info"/&gt;
           &lt;/page&gt;
           &lt;page string="Amenities of the room"&gt;
           &lt;/page&gt;
        &lt;/notebook&gt;
        &lt;/sheet&gt;
     &lt;/form&gt;
   &lt;/field&gt;
 &lt;/record&gt;

 &lt;record model="ir.actions.act_window" id="booking_action"&gt;
     &lt;field name="name"&gt;Book meeting room&lt;/field&gt;
     &lt;field name="res_model"&gt;book.meeting&lt;/field&gt;
     &lt;field name="view_type"&gt;form&lt;/field&gt;
     &lt;field name="view_mode"&gt;tree,form&lt;/field&gt;
     &lt;field name="view_id" ref="book-tree"/&gt;
     &lt;field name="help" type="html"&gt;
          &lt;p&gt;To book a meeting room click create&lt;/p&gt;
 &lt;/field&gt;
 &lt;/record&gt;
</code></pre>

<p>Can anybody help me?</p>