title: How to daily reset a sequence (ir.sequence object) in Odoo 12?
body: <p>I have a custom module in Odoo 12 and I need to create sequences for model records every day so, I need to reset it daily at 00:00 pm. I tried to use scheduler but I can not find which field should I override or reset the sequence I want. As I reviewed the ir_sequence table structure in the database, no values of this table fields are stored in the database, so how we can reset this sequence?</p>
  <p>Here is the code I used as scheduler:</p>
  <pre><code>&lt;odoo&gt;
      &lt;data noupdate=&quot;1&quot;&gt;
          &lt;record id=&quot;ir_cron_token_no_sequence_daily_restart_scheduler&quot; model=&quot;ir.cron&quot;&gt;
              &lt;field name=&quot;name&quot;&gt;Token Nummber Sequence Daily Restart Scheduler&lt;/field&gt;
              &lt;field name=&quot;user_id&quot; ref=&quot;base.user_root&quot;/&gt;
              &lt;field name=&quot;model_id&quot; ref=&quot;acs_hms.model_hms_appointment&quot;/&gt;
              &lt;field name=&quot;interval_number&quot;&gt;1&lt;/field&gt;
              &lt;field name=&quot;interval_type&quot;&gt;days&lt;/field&gt;
              &lt;field name=&quot;numbercall&quot;&gt;-1&lt;/field&gt;
              &lt;field name=&quot;doall&quot; eval=&quot;False&quot;/&gt;
              &lt;field name=&quot;code&quot;&gt;model._reset_token_number_sequences()&lt;/field&gt;
              &lt;field name=&quot;state&quot;&gt;code&lt;/field&gt;
          &lt;/record&gt;
      &lt;/data&gt;
  &lt;/odoo&gt;
  </code></pre>
  <p>This is my _reset_token_number_sequences() method:</p>
  <pre><code>def _reset_token_number_sequences(self):
          sequences = self.env['ir.sequence'].search([('name', '=like', '%nl_department_%')])
          for sequence in sequences:
              print('Sequence is : ', sequence)
              sequence.write({
                  'number_next' : 1,
              })
  </code></pre>
  <p>But it's not working in my case, please help me on which field should I override it from here instead of <code>number_next</code>.</p>