title: How to call a function while odoo loading
body: <p>I'm working in odoo I have problem, the issue is I want a load or call the function while some view trigger</p>
  
  <p>This is my view XML</p>
  
  <pre><code> &lt;page string="Current Allocated" id="curent_book_id"&gt;
                            &lt;field name='book_transactions_id' domain="[('name', '=', 'Odoo Basics')]"&gt;
                              &lt;tree&gt;
                                &lt;!-- &lt;field name="code"&gt;self.check_date()&lt;/field&gt; --&gt;
                                &lt;field name="auto_date_check" invisible="1" /&gt;
                                &lt;field name='from_date'/&gt;
                                &lt;field name='end_date'/&gt;
                                &lt;field name='students_id'/&gt;
                              &lt;/tree&gt;
                             &lt;/field&gt;
  
                         &lt;/page&gt;
  </code></pre>
  
  <p>And model code:</p>
  
  <pre><code>    from_date = fields.Date(string='From Date',default=datetime.today())
      current_status = fields.Boolean(default=True)
      end_date = fields.Date(string='End Date')
      books_id = fields.Many2many('library.books', ondelete='cascade', string="Book Name")
      students_id = fields.Many2many('library.student',string='Student RollNo')
      auto_date_check = fields.Char(compute='check_date', store=False)
  
      @api.onchange('auto_date_check')
      def check_date(self):
  
          return {
                  'warning': {
                              'title': "Something bad happened",
                              'message': "It was very bad indeed",
                              }`enter code here`
                  }
  </code></pre>