Why the sequence of a field changes when saved in Odoo?
<p>I have a form view for <code>sale.order.line</code> model and have created a field (sequence field) called <code>' niu '</code> which increases its value automatically.</p>

<p>For each product type stockable you add to the form which is working fine But I have a problem because when you add a product stackable the value increases, but when I press the 'Save ' button automatically changes the sequence.</p>

<p><strong>See below attached Images :</strong></p>

<p><a href="https://i.stack.imgur.com/kpgYD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kpgYD.png" alt="enter image description here"></a></p>

<p><a href="https://i.stack.imgur.com/3qgj5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3qgj5.png" alt="enter image description here"></a></p>

<p>This is the ' niu ' field and sale.order.line method within the model:</p>

<pre><code>niu = fields.Char(string="NIU", compute="_niu_validation", readonly=True, store=True)

@api.depends('product_id.product_tmpl_id.type')
def _niu_validation(self):
    for rec in self:
        if rec.product_id.product_tmpl_id.type == 'product' and not rec.niu:
                rec.niu = self.env['ir.sequence'].next_by_code('sale.order.line')
</code></pre>

<p>What can I do to make the sequence is not changed and the initial number is established ?</p>