'This function creates move lines on a picking, at the time of do_transfer, based on
unexpected product transfers (or exceeding quantities) found in the pack operations.'

def _create_extra_moves(self):

    self.ensure_one()
    moves = self.env['stock.move']
    for pack_operation in self.pack_operation_ids:
        for (product, remaining_qty) in pack_operation._get_remaining_prod_quantities().items():
            if (float_compare(remaining_qty, 0, precision_rounding=product.uom_id.rounding) > 0):
                vals = self._prepare_values_extra_move(pack_operation, product, remaining_qty)
                moves |= moves.create(vals)
    if moves:
        moves.with_context(skip_check=True).action_confirm()
    return moves
