title: automate sales counter in the model
body: <p>I am trying to make an automation in my model through code but I don't know if I am missing something because I add what I found on Google but at the end of a month it is not restored. I wish that through an accountant that I already have the method count the sales made in a month, that currently makes it but at the end of the month it continues adding the sales of the previous month and that I do not want, since the idea is that at the end of a month sales made in a month resume and start at 0. The code I have is as follows:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;data noupdate = "1"&gt;
  
          &lt;record forcecreate = "True" id = "vendor_monthly_counter" model = "ir.cron"&gt;
             &lt;field name = "name"&gt; Monthly worker accountant &lt;/field&gt;
             &lt;field eval = "True" name = "active" /&gt;
             &lt;field name = "user_id" ref = "base.user_root" /&gt;
             &lt;field name = "interval_number"&gt; 1 &lt;/field&gt;
             &lt;field name = "interval_type"&gt; months &lt;/field&gt;
             &lt;field name = "numbercall"&gt; - 1 &lt;/field&gt;
             &lt;field ref = "model_proyecto_rc_trabajador" name = "model_id" /&gt;
              &lt;field name = "state"&gt; code &lt;/field&gt;
             &lt;field name = "code"&gt; model.get_realized_sales () &lt;/field&gt;
             &lt;field eval = "False" name = "doall" /&gt;
             &lt;field name = "function"&gt; True &lt;/field&gt;
  </code></pre>
  
  <p><strong>py get_realized_sales</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>class worker(models.Model):
      _name = 'project_rc.worker'
      _rec_name = 'name'
  
      name = fields.Char(string="Name", required=True)
      charge = fields.Selection(
          [('seller', 'Seller'), ('cashier', 'Cashier')],
          string="Cargo", required=True)
      sales_counter = fields.Integer(
          string="Sales made", compute="get_realized_sales", store=True)
      document_ids = fields.One2many(
          comodel_name='project_rc.document', inverse_name='worker_id',
          string='Invoice', required=true)
  
      @api.depends ('document_ids')
      def get_realized_sales(self):
          for rec in self:
              document = rec.document_ids.filtered(
                  lambda r: r.type_movimiento_id and\
                      r.type_movement_id.type_movement == 'sale')
              rec.sales_counter = len(document)
  </code></pre>
  
  <p>What could I miss, some py? and how would that py be?</p>