
from odoo import models


class MrpProduction(models.Model):
    _inherit = "mrp.production"

    def _reset_work_order_sequence(self):
        for rec in self:
            current_sequence = 1
            for work in rec.workorder_ids:
                work.sequence = current_sequence
                current_sequence += 1

    def _generate_workorders(self, exploded_boms):
        res = super()._generate_workorders(exploded_boms)
        self._reset_work_order_sequence()
        return res


from odoo import models


class MrpProduction(models.Model):
    _inherit = "mrp.production"

    def _reset_work_order_sequence(self):
        for rec in self:
            current_sequence = 1
            for work in rec.workorder_ids:
                work.sequence = current_sequence
                current_sequence += 1

    def _create_workorder(self):
        res = super()._create_workorder()
        self._reset_work_order_sequence()
        return res

Call method changed on v14
[FIX] mrp_workorder_sequence: Call method changed on v14

  
  from odoo import models
  
  
  class MrpProduction(models.Model):
      _inherit = "mrp.production"
  
      def _reset_work_order_sequence(self):
          for rec in self:
              current_sequence = 1
              for work in rec.workorder_ids:
                  work.sequence = current_sequence
                  current_sequence += 1
  
-     def _generate_workorders(self, exploded_boms):
+     def _create_workorder(self):
-         res = super()._generate_workorders(exploded_boms)
+         res = super()._create_workorder()
          self._reset_work_order_sequence()
          return res
  
Call method changed on v14
## Code Before:

from odoo import models


class MrpProduction(models.Model):
    _inherit = "mrp.production"

    def _reset_work_order_sequence(self):
        for rec in self:
            current_sequence = 1
            for work in rec.workorder_ids:
                work.sequence = current_sequence
                current_sequence += 1

    def _generate_workorders(self, exploded_boms):
        res = super()._generate_workorders(exploded_boms)
        self._reset_work_order_sequence()
        return res

## Instruction:
Call method changed on v14
## Code After:

from odoo import models


class MrpProduction(models.Model):
    _inherit = "mrp.production"

    def _reset_work_order_sequence(self):
        for rec in self:
            current_sequence = 1
            for work in rec.workorder_ids:
                work.sequence = current_sequence
                current_sequence += 1

    def _create_workorder(self):
        res = super()._create_workorder()
        self._reset_work_order_sequence()
        return res
