
from odoo import api, models


class StockMove(models.Model):
    _inherit = 'stock.move'

    @api.model
    def _prepare_picking_assign(self, move):
        values = super(StockMove, self)._prepare_picking_assign(move)
        if move.procurement_id.sale_line_id:
            sale = move.procurement_id.sale_line_id.order_id
            values['workflow_process_id'] = sale.workflow_process_id.id
        return values


from odoo import api, models


class StockMove(models.Model):
    _inherit = 'stock.move'

    @api.multi
    def _get_new_picking_values(self):
        values = super(StockMove, self)._get_new_picking_values()
        if self.procurement_id.sale_line_id:
            sale = self.procurement_id.sale_line_id.order_id
            values['workflow_process_id'] = sale.workflow_process_id.id
        return values

Fix API type & method name for picking values
Fix API type & method name for picking values

  
  from odoo import api, models
  
  
  class StockMove(models.Model):
      _inherit = 'stock.move'
  
-     @api.model
+     @api.multi
-     def _prepare_picking_assign(self, move):
+     def _get_new_picking_values(self):
-         values = super(StockMove, self)._prepare_picking_assign(move)
+         values = super(StockMove, self)._get_new_picking_values()
-         if move.procurement_id.sale_line_id:
+         if self.procurement_id.sale_line_id:
-             sale = move.procurement_id.sale_line_id.order_id
+             sale = self.procurement_id.sale_line_id.order_id
              values['workflow_process_id'] = sale.workflow_process_id.id
          return values
  
Fix API type & method name for picking values
## Code Before:

from odoo import api, models


class StockMove(models.Model):
    _inherit = 'stock.move'

    @api.model
    def _prepare_picking_assign(self, move):
        values = super(StockMove, self)._prepare_picking_assign(move)
        if move.procurement_id.sale_line_id:
            sale = move.procurement_id.sale_line_id.order_id
            values['workflow_process_id'] = sale.workflow_process_id.id
        return values

## Instruction:
Fix API type & method name for picking values
## Code After:

from odoo import api, models


class StockMove(models.Model):
    _inherit = 'stock.move'

    @api.multi
    def _get_new_picking_values(self):
        values = super(StockMove, self)._get_new_picking_values()
        if self.procurement_id.sale_line_id:
            sale = self.procurement_id.sale_line_id.order_id
            values['workflow_process_id'] = sale.workflow_process_id.id
        return values
