parameters: (self)
docstring: Action to put move lines with 'Done' quantities into a new pack
          This method follows same logic to stock.picking.
docstring_summary: Action to put move lines with 'Done' quantities into a new pack
          This method follows same logic to stock.picking.
docstring_tokens: Action to put move lines with Done quantities into a new pack This method follows same logic to stock . picking .
function: def action_put_in_pack(self):
          """ Action to put move lines with 'Done' quantities into a new pack
          This method follows same logic to stock.picking.
          """
          self.ensure_one()
          if self.state not in ('done', 'cancel'):
              picking_move_lines = self.move_line_ids
  
              move_line_ids = picking_move_lines.filtered(lambda ml:
                  float_compare(ml.qty_done, 0.0, precision_rounding=ml.product_uom_id.rounding) > 0
                  and not ml.result_package_id
              )
              if not move_line_ids:
                  move_line_ids = picking_move_lines.filtered(lambda ml: float_compare(ml.product_uom_qty, 0.0,
                                       precision_rounding=ml.product_uom_id.rounding) > 0 and float_compare(ml.qty_done, 0.0,
                                       precision_rounding=ml.product_uom_id.rounding) == 0)
              if move_line_ids:
                  res = self.picking_ids[0]._pre_put_in_pack_hook(move_line_ids)
                  if not res:
                      res = self.picking_ids[0]._put_in_pack(move_line_ids, False)
                  return res
              else:
                  raise UserError(_("Please add 'Done' quantities to the batch picking to create a new pack."))
function_tokens: def action_put_in_pack ( self ) : self . ensure_one ( ) if self . state not in ( 'done' , 'cancel' ) : picking_move_lines = self . move_line_ids move_line_ids = picking_move_lines . filtered ( lambda ml : float_compare ( ml . qty_done , 0.0 , precision_rounding = ml . product_uom_id . rounding ) > 0 and not ml . result_package_id ) if not move_line_ids : move_line_ids = picking_move_lines . filtered ( lambda ml : float_compare ( ml . product_uom_qty , 0.0 , precision_rounding = ml . product_uom_id . rounding ) > 0 and float_compare ( ml . qty_done , 0.0 , precision_rounding = ml . product_uom_id . rounding ) == 0 ) if move_line_ids : res = self . picking_ids [ 0 ] . _pre_put_in_pack_hook ( move_line_ids ) if not res : res = self . picking_ids [ 0 ] . _put_in_pack ( move_line_ids , False ) return res else : raise UserError ( _ ( "Please add 'Done' quantities to the batch picking to create a new pack." ) )